Module: LazyLazer::ClassMethods
- Defined in:
- lib/lazy_lazer.rb
Overview
The methods to extend the class with.
Instance Method Summary collapse
-
#inherited(klass) ⇒ void
Copies parent properties into subclasses.
-
#property(name, *bool_options, **options) ⇒ Symbol
Define a property.
Instance Method Details
#inherited(klass) ⇒ void
This method returns an undefined value.
Copies parent properties into subclasses.
31 32 33 |
# File 'lib/lazy_lazer.rb', line 31 def inherited(klass) klass.instance_variable_set(:@_lazer_metadata, @_lazer_metadata.dup) end |
#property(name, *bool_options, **options) ⇒ Symbol
Define a property.
56 57 58 59 60 |
# File 'lib/lazy_lazer.rb', line 56 def property(name, *, **) sym_name = name.to_sym @_lazer_metadata.add(sym_name, KeyMetadata.new(sym_name, *, **)) define_method(sym_name) { read_attribute(sym_name) } end |