Class: NewStoreApi::AddOnLinks
- Defined in:
- lib/new_store_api/models/add_on_links.rb
Overview
AddOnLinks Model.
Instance Attribute Summary collapse
-
#change_add_on ⇒ Link
TODO: Write general description for this method.
-
#mself ⇒ Link
TODO: Write general description for this method.
-
#remove_add_on ⇒ Link
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(mself = nil, change_add_on = SKIP, remove_add_on = SKIP) ⇒ AddOnLinks
constructor
A new instance of AddOnLinks.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(mself = nil, change_add_on = SKIP, remove_add_on = SKIP) ⇒ AddOnLinks
Returns a new instance of AddOnLinks.
46 47 48 49 50 |
# File 'lib/new_store_api/models/add_on_links.rb', line 46 def initialize(mself = nil, change_add_on = SKIP, remove_add_on = SKIP) @change_add_on = change_add_on unless change_add_on == SKIP @remove_add_on = remove_add_on unless remove_add_on == SKIP @mself = mself end |
Instance Attribute Details
#change_add_on ⇒ Link
TODO: Write general description for this method
14 15 16 |
# File 'lib/new_store_api/models/add_on_links.rb', line 14 def change_add_on @change_add_on end |
#mself ⇒ Link
TODO: Write general description for this method
22 23 24 |
# File 'lib/new_store_api/models/add_on_links.rb', line 22 def mself @mself end |
#remove_add_on ⇒ Link
TODO: Write general description for this method
18 19 20 |
# File 'lib/new_store_api/models/add_on_links.rb', line 18 def remove_add_on @remove_add_on end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/new_store_api/models/add_on_links.rb', line 53 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. mself = Link.from_hash(hash['self']) if hash['self'] change_add_on = Link.from_hash(hash['change_add_on']) if hash['change_add_on'] remove_add_on = Link.from_hash(hash['remove_add_on']) if hash['remove_add_on'] # Create object from extracted values. AddOnLinks.new(mself, change_add_on, remove_add_on) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/new_store_api/models/add_on_links.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['change_add_on'] = 'change_add_on' @_hash['remove_add_on'] = 'remove_add_on' @_hash['mself'] = 'self' @_hash end |
.nullables ⇒ Object
An array for nullable fields
42 43 44 |
# File 'lib/new_store_api/models/add_on_links.rb', line 42 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 39 |
# File 'lib/new_store_api/models/add_on_links.rb', line 34 def self.optionals %w[ change_add_on remove_add_on ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
75 76 77 78 79 |
# File 'lib/new_store_api/models/add_on_links.rb', line 75 def inspect class_name = self.class.name.split('::').last "<#{class_name} change_add_on: #{@change_add_on.inspect}, remove_add_on:"\ " #{@remove_add_on.inspect}, mself: #{@mself.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
68 69 70 71 72 |
# File 'lib/new_store_api/models/add_on_links.rb', line 68 def to_s class_name = self.class.name.split('::').last "<#{class_name} change_add_on: #{@change_add_on}, remove_add_on: #{@remove_add_on}, mself:"\ " #{@mself}>" end |