Module: Lims::Core::Base::AccessibleViaSuper
- Defined in:
- lib/lims-core/base.rb
Instance Method Summary collapse
-
#attributes_for_dirty ⇒ Object
Like attributes but allow class to define a version without side effet.
- #initialize(*args, &block) ⇒ Object
Instance Method Details
#attributes_for_dirty ⇒ Object
Like attributes but allow class to define a version without side effet. For example attribute on a UuidResource will generate an uuid. This is the method called by dirty_key_for
34 35 36 |
# File 'lib/lims-core/base.rb', line 34 def attributes_for_dirty attributes end |
#initialize(*args, &block) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/lims-core/base.rb', line 17 def initialize(*args, &block) # readonly attributes are normaly not allowed in constructor # by Virtus. We need to call set_attributes explicitely = args. # we would use `options & [:row ... ]` if we could # but Sequel redefine Hash#& ... initializables = self.class.attributes.select {|a| a.[:initializable] == true } = .subset(initializables.map(&:name)) set_attributes() super(*args, - , &block).tap { } end |