Class: Warframe::Models::Base
- Inherits:
-
Object
- Object
- Warframe::Models::Base
- Defined in:
- lib/warframe/models/base.rb
Overview
Warframe Base Model.
Direct Known Subclasses
Alert, CambionDrift, Cetus, ConclaveChallenge, GlobalUpgrade, Invasion, News, Nightwave, Sortie, SteelPath, SyndicateMission
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
Creates a new [Warframe::Models::Base] instance.
Constructor Details
#initialize(options = {}) ⇒ Base
Creates a new [Warframe::Models::Base] instance.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/warframe/models/base.rb', line 14 def initialize( = {}) if .is_a? Array from_array else .each do |k, v| renamed = k.to_s.underscore v = v.map { |obj| OpenStruct.new obj } if v.is_a?(Array) && v[0].is_a?(Hash) v = OpenStruct.new v if v.is_a? Hash instance_variable_set "@#{renamed}", v end end end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
10 11 12 |
# File 'lib/warframe/models/base.rb', line 10 def code @code end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
10 11 12 |
# File 'lib/warframe/models/base.rb', line 10 def error @error end |