Class: Upcoming::State

Inherits:
Object
  • Object
show all
Includes:
Defaults
Defined in:
lib/upcoming/state.rb

Class Method Summary collapse

Methods included from Defaults

included

Class Method Details

.info(state_id) ⇒ Object

state_id (Required) The state_id number of the state to look within. State ID’s are referenced in other methods, such as metro.getStateList and metro.getInfo. To run getInfo on multiple states, simply pass an array or a comma-separated list of state_id numbers.



8
9
10
11
# File 'lib/upcoming/state.rb', line 8

def self.info(state_id)
  state_id = state_id.join(',') if state_id.is_a?(Array)
  Mash.new(self.get('/', :query => {:method => 'state.getInfo', :state_id => state_id}.merge(Upcoming.default_options))).rsp.state
end