Class: Pepipost::Attributes
- Inherits:
-
Object
- Object
- Pepipost::Attributes
- Defined in:
- lib/pepipost/models/attributes.rb
Instance Attribute Summary collapse
-
#name ⇒ Array<String>
TODO: Write general description for this method.
-
#regid ⇒ Array<String>
TODO: Write general description for this method.
Instance Method Summary collapse
-
#key_map ⇒ Object
Defines the key map for json serialization.
- #method_missing(method_name) ⇒ Object
-
#to_json ⇒ Object
Creates JSON of the curent object.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name) ⇒ Object
11 12 13 |
# File 'lib/pepipost/models/attributes.rb', line 11 def method_missing(method_name) puts "there's no method called '#{method_name}'" end |
Instance Attribute Details
#name ⇒ Array<String>
TODO: Write general description for this method
5 6 7 |
# File 'lib/pepipost/models/attributes.rb', line 5 def name @name end |
#regid ⇒ Array<String>
TODO: Write general description for this method
9 10 11 |
# File 'lib/pepipost/models/attributes.rb', line 9 def regid @regid end |
Instance Method Details
#key_map ⇒ Object
Defines the key map for json serialization
22 23 24 25 26 27 |
# File 'lib/pepipost/models/attributes.rb', line 22 def key_map hash = {} hash['NAME'] = name hash['REGID'] = regid hash end |
#to_json ⇒ Object
Creates JSON of the curent object
16 17 18 19 |
# File 'lib/pepipost/models/attributes.rb', line 16 def to_json hash = key_map hash.to_json end |