Class: Authlete::Model::SnsCredentials
- Inherits:
-
Object
- Object
- Authlete::Model::SnsCredentials
- Defined in:
- lib/authlete/model/sns-credentials.rb
Instance Attribute Summary collapse
-
#apiKey ⇒ Object
(also: #api_key)
The API key.
-
#apiSecret ⇒ Object
(also: #api_secret)
The API secret.
-
#sns ⇒ Object
The SNS.
Class Method Summary collapse
-
.parse(hash) ⇒ Object
Construct an instance from the given hash.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#to_hash ⇒ Object
Convert this object into a hash.
-
#update(hash) ⇒ Object
Set attribute values using the given hash.
Instance Attribute Details
#apiKey ⇒ Object Also known as: api_key
The API key. (String)
25 26 27 |
# File 'lib/authlete/model/sns-credentials.rb', line 25 def apiKey @apiKey end |
#apiSecret ⇒ Object Also known as: api_secret
The API secret. (String)
30 31 32 |
# File 'lib/authlete/model/sns-credentials.rb', line 30 def apiSecret @apiSecret end |
#sns ⇒ Object
The SNS. (String)
Valid values are “FACEBOOK”.
37 38 39 |
# File 'lib/authlete/model/sns-credentials.rb', line 37 def sns @sns end |
Class Method Details
.parse(hash) ⇒ Object
Construct an instance from the given hash.
If the given argument is nil or is not a Hash, nil is returned. Otherwise, SnsCredentials.new(hash) is returned.
100 101 102 103 104 105 106 |
# File 'lib/authlete/model/sns-credentials.rb', line 100 def self.parse(hash) if hash.nil? or (hash.kind_of?(Hash) == false) return nil end return Authlete::Model::SnsCredentials.new(hash) end |
Instance Method Details
#[](key) ⇒ Object
127 128 129 130 131 132 133 134 135 |
# File 'lib/authlete/model/sns-credentials.rb', line 127 def [](key) key = authlete_model_snsCredentials_to_key(key) if respond_to?(key) return send(key) else return nil end end |
#[]=(key, value) ⇒ Object
137 138 139 140 141 142 143 144 145 146 |
# File 'lib/authlete/model/sns-credentials.rb', line 137 def []=(key, value) key = authlete_model_snsCredentials_to_key(key) method = "#{key}=" if respond_to?(method) return send(method, value) else return nil end end |
#to_hash ⇒ Object
Convert this object into a hash.
114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/authlete/model/sns-credentials.rb', line 114 def to_hash hash = {} instance_variables.each do |var| key = var.to_s.delete("@").to_sym val = instance_variable_get(var) hash[key] = val end return hash end |
#update(hash) ⇒ Object
Set attribute values using the given hash.
109 110 111 |
# File 'lib/authlete/model/sns-credentials.rb', line 109 def update(hash) authlete_model_snsCredentials_update(hash) end |