Class: GolfSwitch::Country
- Inherits:
-
AreaResponse
- Object
- AreaResponse
- GolfSwitch::Country
- Defined in:
- lib/golf_switch/country.rb
Instance Attribute Summary collapse
-
#country_regions ⇒ Object
Returns the value of attribute country_regions.
Attributes inherited from AreaResponse
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(area_id = nil, name = nil) ⇒ Country
constructor
A new instance of Country.
- #parse_regions(regions) ⇒ Object
- #regions ⇒ Object
Methods inherited from AreaResponse
Constructor Details
#initialize(area_id = nil, name = nil) ⇒ Country
Returns a new instance of Country.
4 5 6 7 |
# File 'lib/golf_switch/country.rb', line 4 def initialize(area_id=nil,name=nil) super(area_id,name) @country_regions = [] end |
Instance Attribute Details
#country_regions ⇒ Object
Returns the value of attribute country_regions.
3 4 5 |
# File 'lib/golf_switch/country.rb', line 3 def country_regions @country_regions end |
Class Method Details
Instance Method Details
#parse_regions(regions) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/golf_switch/country.rb', line 19 def parse_regions(regions) if regions[:region] && regions[:region].is_a?(Array) regions[:region].each do |region| @country_regions << CountryRegion.parse_region(region) end elsif regions[:region] && regions.is_a?(Hash) @country_regions << CountryRegion.parse_region(regions[:region]) end end |
#regions ⇒ Object
15 16 17 |
# File 'lib/golf_switch/country.rb', line 15 def regions @country_regions end |