Class: EwayRapid::InternalModels::Option
- Inherits:
-
Object
- Object
- EwayRapid::InternalModels::Option
- Defined in:
- lib/eway_rapid/models/internal_models.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
- .from_array(array) ⇒ Object
- .from_hash(hash) ⇒ Object
- .from_json(json) ⇒ Object
- .to_array(array) ⇒ Object
- .to_hash(option) ⇒ Object
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
147 148 149 |
# File 'lib/eway_rapid/models/internal_models.rb', line 147 def value @value end |
Class Method Details
.from_array(array) ⇒ Object
181 182 183 184 185 186 187 188 |
# File 'lib/eway_rapid/models/internal_models.rb', line 181 def self.from_array(array) = [] array.each {|option_hash| obj = Option.from_hash(option_hash) .push(obj) } end |
.from_hash(hash) ⇒ Object
175 176 177 178 179 |
# File 'lib/eway_rapid/models/internal_models.rb', line 175 def self.from_hash(hash) option = Option.new option.value = hash[Constants::VALUE] option end |
.from_json(json) ⇒ Object
170 171 172 173 |
# File 'lib/eway_rapid/models/internal_models.rb', line 170 def self.from_json(json) hash = JSON.parse(json) from_hash(hash) end |