Class: ShelbyArena::ApiObject
- Inherits:
-
Object
- Object
- ShelbyArena::ApiObject
- Defined in:
- lib/api/api_object.rb
Overview
This class is the base class for all ShelbyArena objects and is meant to be inherited.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#error_messages ⇒ Object
readonly
Returns the value of attribute error_messages.
-
#marked_for_destruction ⇒ Object
readonly
Returns the value of attribute marked_for_destruction.
Instance Method Summary collapse
-
#initialize_from_json_object(object_attributes) ⇒ Object
Initializes the current object from the JSON data that was loaded into the Hash.
Instance Attribute Details
#error_messages ⇒ Object (readonly)
Returns the value of attribute error_messages.
9 10 11 |
# File 'lib/api/api_object.rb', line 9 def end |
#marked_for_destruction ⇒ Object (readonly)
Returns the value of attribute marked_for_destruction.
9 10 11 |
# File 'lib/api/api_object.rb', line 9 def marked_for_destruction @marked_for_destruction end |
Instance Method Details
#initialize_from_json_object(object_attributes) ⇒ Object
Initializes the current object from the JSON data that was loaded into the Hash
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/api/api_object.rb', line 14 def initialize_from_json_object(object_attributes) if object_attributes.is_a?( Hash ) object_attributes.each do |key, value| method_to_call = "#{ShelbyArena::attr_underscore(key)}=" if respond_to?(method_to_call) self.send(method_to_call, value) else # debugger # asdf=234 # puts "Missing :=> ".red + method_to_call.to_s # Show the missing methods end end end end |