Module: Rlocu

Defined in:
lib/utilities.rb,
lib/rlocu/menu.rb,
lib/rlocu/venue.rb,
lib/rlocu/config.rb,
lib/rlocu/version.rb,
lib/rlocu/venue_search.rb,
lib/rlocu/venue_details.rb

Defined Under Namespace

Modules: VenueDetails, VenueSearch Classes: Bounds, Location, Menu, MenuItem, Option, OptionGroup, Section, SectionText, Subsection, Venue

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.api_keyObject



12
13
14
# File 'lib/rlocu/config.rb', line 12

def api_key
  @api_key
end

.config!(file = File.expand_path("../../../.config", __FILE__)) ⇒ Object



6
7
8
9
10
# File 'lib/rlocu/config.rb', line 6

def config!(file=File.expand_path("../../../.config", __FILE__))
  configs = YAML::load(File.open(file))
  @api_key = configs['API_KEY']  
  @http_base = configs['HTTP_BASE']  
end

.encode(params = {}) ⇒ Object



5
6
7
8
# File 'lib/utilities.rb', line 5

def self.encode(params={})
  s = params.reduce("api_key=#{Rlocu.api_key}&") {|memo,(key,val)| memo << "#{key.to_s}=#{val}&"}
  URI::encode(s.chop)
end

.http_baseObject



16
17
18
# File 'lib/rlocu/config.rb', line 16

def http_base
  @http_base
end