Class: Regio::Core
Direct Known Subclasses
Constant Summary collapse
- COMPONENTS =
[ { name: :country, type: 'A0' }, { name: :county, type: 'A1' }, { name: :municipality, type: 'A2' }, { name: :settlement, type: 'A3' }, { name: :small_place, type: 'A4' }, { name: :street, type: 'A5' }, { name: :farmstead, type: 'A6' }, { name: :house, type: 'A7' }, { name: :apartment, type: 'A8' } ].freeze
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Core
constructor
A new instance of Core.
- #run(path, params = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Core
Returns a new instance of Core.
13 14 15 |
# File 'lib/regio/core.rb', line 13 def initialize( = {}) @options = .merge() end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
11 12 13 |
# File 'lib/regio/core.rb', line 11 def @options end |
Instance Method Details
#run(path, params = {}) ⇒ Object
29 30 31 |
# File 'lib/regio/core.rb', line 29 def run(path, params = {}) JSON.parse(self.class.get(path, query: params).body, symbolize_names: true) end |