Module: Mjai::WithFields
Instance Attribute Summary collapse
-
#field_names ⇒ Object
readonly
Returns the value of attribute field_names.
Instance Method Summary collapse
Instance Attribute Details
#field_names ⇒ Object (readonly)
Returns the value of attribute field_names.
14 15 16 |
# File 'lib/mjai/with_fields.rb', line 14 def field_names @field_names end |
Instance Method Details
#define_fields(names) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/mjai/with_fields.rb', line 5 def define_fields(names) @field_names = names @field_names.each() do |name| define_method(name) do return @fields[name] end end end |