Class: Jsapi::Model::Base
- Inherits:
-
Object
- Object
- Jsapi::Model::Base
- Extended by:
- Naming
- Includes:
- Attributes, Validations
- Defined in:
- lib/jsapi/model/base.rb
Overview
The base API model used to represent top-level parameters and nested object parameters by default.
Instance Method Summary collapse
-
#==(other) ⇒ Object
:nodoc:.
-
#initialize(nested) ⇒ Base
constructor
A new instance of Base.
-
#inspect ⇒ Object
:nodoc:.
Methods included from Naming
Methods included from Validations
Methods included from Attributes
#method_missing, #respond_to_missing?
Constructor Details
#initialize(nested) ⇒ Base
Returns a new instance of Base.
13 14 15 |
# File 'lib/jsapi/model/base.rb', line 13 def initialize(nested) @nested = nested end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Jsapi::Model::Attributes
Instance Method Details
#==(other) ⇒ Object
:nodoc:
17 18 19 20 21 22 |
# File 'lib/jsapi/model/base.rb', line 17 def ==(other) # :nodoc: super || ( self.class == other.class && attributes == other.attributes ) end |
#inspect ⇒ Object
:nodoc:
24 25 26 27 |
# File 'lib/jsapi/model/base.rb', line 24 def inspect # :nodoc: "#<#{self.class.name} " \ "#{attributes.map { |k, v| "#{k}: #{v.inspect}" }.join(', ')}>" end |