Class: Raas::RewardCredentialModel
- Defined in:
- lib/raas/models/reward_credential_model.rb
Overview
Represents a Reward Credential
Instance Attribute Summary collapse
-
#label ⇒ String
The label of the credential.
-
#type ⇒ String
The type of the credential.
-
#value ⇒ String
The actual credential.
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.
Instance Method Summary collapse
-
#initialize(label = nil, value = nil, type = nil) ⇒ RewardCredentialModel
constructor
A new instance of RewardCredentialModel.
Methods inherited from BaseModel
Constructor Details
#initialize(label = nil, value = nil, type = nil) ⇒ RewardCredentialModel
Returns a new instance of RewardCredentialModel.
28 29 30 31 32 33 34 |
# File 'lib/raas/models/reward_credential_model.rb', line 28 def initialize(label = nil, value = nil, type = nil) @label = label @value = value @type = type end |
Instance Attribute Details
#label ⇒ String
The label of the credential
9 10 11 |
# File 'lib/raas/models/reward_credential_model.rb', line 9 def label @label end |
#type ⇒ String
The type of the credential
17 18 19 |
# File 'lib/raas/models/reward_credential_model.rb', line 17 def type @type end |
#value ⇒ String
The actual credential
13 14 15 |
# File 'lib/raas/models/reward_credential_model.rb', line 13 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/raas/models/reward_credential_model.rb', line 37 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. label = hash['label'] value = hash['value'] type = hash['type'] # Create object from extracted values. RewardCredentialModel.new(label, value, type) end |
.names ⇒ Object
A mapping from model property names to API property names.
20 21 22 23 24 25 26 |
# File 'lib/raas/models/reward_credential_model.rb', line 20 def self.names @_hash = {} if @_hash.nil? @_hash['label'] = 'label' @_hash['value'] = 'value' @_hash['type'] = 'type' @_hash end |