Class: AdvancedBilling::Metadata
- Defined in:
- lib/advanced_billing/models/metadata.rb
Overview
Metadata Model.
Instance Attribute Summary collapse
-
#deleted_at ⇒ String
TODO: Write general description for this method.
-
#id ⇒ Integer
TODO: Write general description for this method.
-
#metafield_id ⇒ Float
TODO: Write general description for this method.
-
#name ⇒ String
TODO: Write general description for this method.
-
#resource_id ⇒ Integer
TODO: Write general description for this method.
-
#value ⇒ String
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(id = SKIP, value = SKIP, resource_id = SKIP, name = SKIP, deleted_at = SKIP, metafield_id = SKIP) ⇒ Metadata
constructor
A new instance of Metadata.
Methods inherited from BaseModel
Constructor Details
#initialize(id = SKIP, value = SKIP, resource_id = SKIP, name = SKIP, deleted_at = SKIP, metafield_id = SKIP) ⇒ Metadata
Returns a new instance of Metadata.
67 68 69 70 71 72 73 74 75 |
# File 'lib/advanced_billing/models/metadata.rb', line 67 def initialize(id = SKIP, value = SKIP, resource_id = SKIP, name = SKIP, deleted_at = SKIP, = SKIP) @id = id unless id == SKIP @value = value unless value == SKIP @resource_id = resource_id unless resource_id == SKIP @name = name unless name == SKIP @deleted_at = deleted_at unless deleted_at == SKIP @metafield_id = unless == SKIP end |
Instance Attribute Details
#deleted_at ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/advanced_billing/models/metadata.rb', line 30 def deleted_at @deleted_at end |
#id ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/metadata.rb', line 14 def id @id end |
#metafield_id ⇒ Float
TODO: Write general description for this method
34 35 36 |
# File 'lib/advanced_billing/models/metadata.rb', line 34 def @metafield_id end |
#name ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/advanced_billing/models/metadata.rb', line 26 def name @name end |
#resource_id ⇒ Integer
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/metadata.rb', line 22 def resource_id @resource_id end |
#value ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/metadata.rb', line 18 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/advanced_billing/models/metadata.rb', line 78 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP value = hash.key?('value') ? hash['value'] : SKIP resource_id = hash.key?('resource_id') ? hash['resource_id'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP deleted_at = hash.key?('deleted_at') ? hash['deleted_at'] : SKIP = hash.key?('metafield_id') ? hash['metafield_id'] : SKIP # Create object from extracted values. Metadata.new(id, value, resource_id, name, deleted_at, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/advanced_billing/models/metadata.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['value'] = 'value' @_hash['resource_id'] = 'resource_id' @_hash['name'] = 'name' @_hash['deleted_at'] = 'deleted_at' @_hash['metafield_id'] = 'metafield_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 64 65 |
# File 'lib/advanced_billing/models/metadata.rb', line 61 def self.nullables %w[ deleted_at ] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/advanced_billing/models/metadata.rb', line 49 def self.optionals %w[ id value resource_id name deleted_at metafield_id ] end |