Class: EML::ModelHash
- Inherits:
-
Object
- Object
- EML::ModelHash
- Extended by:
- T::Sig
- Defined in:
- lib/eml/lib/model_hash.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(model) ⇒ ModelHash
constructor
A new instance of ModelHash.
Constructor Details
Class Method Details
.call(model) ⇒ Object
9 10 11 |
# File 'lib/eml/lib/model_hash.rb', line 9 def self.call(model) new(model).call end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/eml/lib/model_hash.rb', line 20 def call @model.class.enumerate_fields do |_, local_name| value = @model.public_send(local_name) add_value(local_name, value) end @hash end |