Module: Miasma::Utils::Lazy
- Included in:
- Types::Api, Types::Data
- Defined in:
- lib/miasma/utils/lazy.rb
Overview
Adds functionality to facilitate laziness
Defined Under Namespace
Modules: ClassMethods, InstanceMethods
Class Method Summary (collapse)
-
+ (Object) included(klass)
Injects laziness into class.
Class Method Details
+ (Object) included(klass)
Injects laziness into class
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/miasma/utils/lazy.rb', line 217 def included(klass) klass.class_eval do include InstanceMethods extend ClassMethods class << self def inherited(klass) klass.set_attributes( MultiJson.load( MultiJson.dump(self.attributes) ).to_smash ) end end end end |