rlocu 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/README.md +27 -26
- data/Rakefile +8 -7
- data/lib/rlocu.rb +21 -6
- data/lib/rlocu/geo_json.rb +22 -0
- data/lib/rlocu/menu.rb +113 -99
- data/lib/rlocu/query_builder.rb +55 -0
- data/lib/rlocu/utilities/lat_long_radius.rb +27 -0
- data/lib/rlocu/venue.rb +107 -24
- data/lib/rlocu/venue_query.rb +35 -0
- data/lib/rlocu/venue_search.rb +39 -21
- data/lib/rlocu/version.rb +1 -1
- data/rlocu.gemspec +13 -12
- data/spec/config_rlocu_spec_helper.rb +5 -0
- data/spec/geo_json_spec.rb +12 -0
- data/spec/menu/item_spec.rb +13 -0
- data/spec/menu/menu_item_spec.rb +13 -0
- data/spec/menu/option_group_spec.rb +10 -0
- data/spec/menu/option_spec.rb +9 -0
- data/spec/menu/section_spec.rb +9 -0
- data/spec/menu/section_text_spec.rb +9 -0
- data/spec/menu/subsection_spec.rb +9 -0
- data/spec/menu_spec.rb +9 -0
- data/spec/query/key_value_condition_spec.rb +37 -0
- data/spec/spec_helper.rb +99 -0
- data/spec/support/rspec_helpers.rb +53 -0
- data/spec/utilities/lat_long_radius_spec.rb +7 -0
- data/spec/venue_query_spec.rb +29 -0
- data/spec/venue_search_spec.rb +31 -0
- metadata +59 -25
- data/lib/rlocu/config.rb +0 -23
- data/lib/rlocu/venue_details.rb +0 -35
- data/lib/utilities.rb +0 -40
- data/test/test_truth.rb +0 -7
- data/test/test_utilities.rb +0 -21
- data/test/test_venue.rb +0 -15
- data/test/test_venue_details.rb +0 -11
- data/test/test_venue_search.rb +0 -26
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
require 'rlocu'
|
2
|
+
Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f }
|
3
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
4
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
5
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
6
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
7
|
+
# files.
|
8
|
+
#
|
9
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
10
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
11
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
12
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
13
|
+
# a separate helper file that requires the additional dependencies and performs
|
14
|
+
# the additional setup, and require it from the spec files that actually need
|
15
|
+
# it.
|
16
|
+
#
|
17
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
18
|
+
# users commonly want.
|
19
|
+
#
|
20
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
21
|
+
RSpec.configure do |config|
|
22
|
+
# rspec-expectations config goes here. You can use an alternate
|
23
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
24
|
+
# assertions if you prefer.
|
25
|
+
config.expect_with :rspec do |expectations|
|
26
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
27
|
+
# and `failure_message` of custom matchers include text for helper methods
|
28
|
+
# defined using `chain`, e.g.:
|
29
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
30
|
+
# # => "be bigger than 2 and smaller than 4"
|
31
|
+
# ...rather than:
|
32
|
+
# # => "be bigger than 2"
|
33
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
34
|
+
end
|
35
|
+
|
36
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
37
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
38
|
+
config.mock_with :rspec do |mocks|
|
39
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
40
|
+
# a real object. This is generally recommended, and will default to
|
41
|
+
# `true` in RSpec 4.
|
42
|
+
mocks.verify_partial_doubles = true
|
43
|
+
end
|
44
|
+
|
45
|
+
# The settings below are suggested to provide a good initial experience
|
46
|
+
# with RSpec, but feel free to customize to your heart's content.
|
47
|
+
config.order = :random
|
48
|
+
=begin
|
49
|
+
# These two settings work together to allow you to limit a spec run
|
50
|
+
# to individual examples or groups you care about by tagging them with
|
51
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
52
|
+
# get run.
|
53
|
+
config.filter_run :focus
|
54
|
+
config.run_all_when_everything_filtered = true
|
55
|
+
|
56
|
+
# Allows RSpec to persist some state between runs in order to support
|
57
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
58
|
+
# you configure your source control system to ignore this file.
|
59
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
60
|
+
|
61
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
62
|
+
# recommended. For more details, see:
|
63
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
64
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
65
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
66
|
+
config.disable_monkey_patching!
|
67
|
+
|
68
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
69
|
+
# be too noisy due to issues in dependencies.
|
70
|
+
config.warnings = true
|
71
|
+
|
72
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
73
|
+
# file, and it's useful to allow more verbose output when running an
|
74
|
+
# individual spec file.
|
75
|
+
if config.files_to_run.one?
|
76
|
+
# Use the documentation formatter for detailed output,
|
77
|
+
# unless a formatter has already been configured
|
78
|
+
# (e.g. via a command-line flag).
|
79
|
+
config.default_formatter = 'doc'
|
80
|
+
end
|
81
|
+
|
82
|
+
# Print the 10 slowest examples and example groups at the
|
83
|
+
# end of the spec run, to help surface which specs are running
|
84
|
+
# particularly slow.
|
85
|
+
config.profile_examples = 10
|
86
|
+
|
87
|
+
# Run specs in random order to surface order dependencies. If you find an
|
88
|
+
# order dependency and want to debug it, you can fix the order by providing
|
89
|
+
# the seed, which is printed after each run.
|
90
|
+
# --seed 1234
|
91
|
+
config.order = :random
|
92
|
+
|
93
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
94
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
95
|
+
# test failures related to randomization by passing the same `--seed` value
|
96
|
+
# as the one that triggered the failure.
|
97
|
+
Kernel.srand config.seed
|
98
|
+
=end
|
99
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module RspecHelpers
|
2
|
+
def menu_option
|
3
|
+
{'name' => 'spec', 'price' => '1'}
|
4
|
+
end
|
5
|
+
|
6
|
+
def menu_options
|
7
|
+
[menu_option]
|
8
|
+
end
|
9
|
+
|
10
|
+
def menu_option_group
|
11
|
+
{'type' => 'spec', 'text' => 'foo', 'options' => menu_options}
|
12
|
+
end
|
13
|
+
|
14
|
+
def menu_option_groups
|
15
|
+
[menu_option_group]
|
16
|
+
end
|
17
|
+
|
18
|
+
def item_hash
|
19
|
+
{'type' => 'type_spec', 'name' => 'name_spec', 'description' => 'description_spec', 'price' => 'price_spec', 'option_groups' => menu_option_groups}
|
20
|
+
end
|
21
|
+
|
22
|
+
def menu_menu_item_hash
|
23
|
+
{'menu_name' => 'spec_menu_name', 'section_name' => 'spec_section_name', 'subsection_name' => 'spec_subsection_name', 'section_text' => 'spec_section_text', 'currency_symbol' => 'currency_spec', 'photos' => 'string, of, urls'}.merge item_hash
|
24
|
+
end
|
25
|
+
|
26
|
+
def menu_section_text_hash
|
27
|
+
{'type' => 'spec_type', 'text' => 'spec_text'}
|
28
|
+
end
|
29
|
+
|
30
|
+
def menu_section_contents_hash
|
31
|
+
{'type' => 'SECTION_TEXT', 'text' => 'text_spec'}
|
32
|
+
end
|
33
|
+
|
34
|
+
def menu_subsection_hash
|
35
|
+
{'subsection_name' => 'spec_subsection_name', 'contents' => [menu_section_contents_hash]}
|
36
|
+
end
|
37
|
+
|
38
|
+
def menu_section_hash
|
39
|
+
{'section_name' => 'spec_section_name', 'subsections' => [menu_subsection_hash]}
|
40
|
+
end
|
41
|
+
|
42
|
+
def menu_hash
|
43
|
+
{'menu_name' => 'menu_name_spec', 'sections' => [menu_section_hash]}
|
44
|
+
end
|
45
|
+
|
46
|
+
def rlocu_result
|
47
|
+
{"status"=>"success", "http_status"=>200, "venues"=>[{"menus"=>[{"menu_name"=>"Take Out", "sections"=>[{"subsections"=>[{"subsection_name"=>"", "contents"=>[{"price"=>"7.95", "type"=>"ITEM", "name"=>"Thai BBQ Chicken", "description"=>"Chicken marinated in yellow curry powder, turmeric, garlic, coriander, herbs, spices, served with fresh vegetables, and sweet chili sauce."}, {"price"=>"7.95", "type"=>"ITEM", "name"=>"BBQ Pork Ribs", "description"=>"B.B.Q. Pork spare ribs marinated in tomatoe sauce, honey, and a hint of ground black pepper"}, {"price"=>"7.95", "type"=>"ITEM", "name"=>"Orange Chicken", "description"=>"Crispy battered chicken in sweet tangy orange-cherry tomato sauce and garnished with sesame seeds."}, {"price"=>"7.75", "type"=>"ITEM", "name"=>"Crispy Orange Tofu", "description"=>"Crispy fried tofu in our sweet tangy orange-cherry tomato sauce."}, {"price"=>"13.75", "type"=>"ITEM", "name"=>"Spinach with Peanut Sauce", "description"=>"Scallion, cashews, cucumber, served over spinach topped with peanut sauce. Choice of chicken or tofu"}]}], "section_name"=>"Assorted Dishes"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"type"=>"ITEM", "name"=>"Thai Fried Rice", "description"=>"Jasmine rice, sauteed with egg, green peas, carrot, onion, and tomato."}, {"type"=>"ITEM", "name"=>"Spicy Fried Rice", "description"=>"Jasmine rice, garlic, onion, carrot, fresh chili, and sweet basil"}, {"type"=>"ITEM", "name"=>"Curry Fried Rice", "description"=>"Jasmine rice, a touch of yellow curry powder, egg, onion, green peas, carrot, and tomato."}, {"price"=>"8.50", "type"=>"ITEM", "name"=>"Crab Fried Rice (Crab Only)", "description"=>"Jasmine rice, crab, egg, green peas, carrot, and onion."}, {"price"=>"9.50", "type"=>"ITEM", "name"=>"Pineapple Fried Rice", "description"=>"Jasmine rice, a touch of curry powder, sauteed egg, cashew nut, raisin, pineapple, chicken, and shrimp."}]}], "section_name"=>"Fried Rice"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"price"=>"10.75", "type"=>"ITEM", "name"=>"Shrimp with Chili", "description"=>"Shrimp sauteed with chili paste and served with steamed vegetables"}, {"price"=>"13.75", "type"=>"ITEM", "name"=>"Crispy Trout", "description"=>"Whole fish seasoned with herbs, spices, and crispy fried, served with mango, cashews, onion, cilantro, and lime juice."}, {"price"=>"13.75", "type"=>"ITEM", "name"=>"Spicy Mint Seafood", "description"=>"Scallops, shrimps, sweet basil, onion, bell pepper in savory chili sauce."}, {"price"=>"13.75", "type"=>"ITEM", "name"=>"Yellow Curry Combination Seafood", "description"=>"Shrimp, calamari, scallops, mussels, crab, fillet, egg, celery, carrot, and onion sauteed in yellow curry powder."}, {"price"=>"13.75", "type"=>"ITEM", "name"=>"Supreme Seafood", "description"=>"Shrimp, calamari, scallops, mussels, crab, fillet, sweet basil onion, bell pepper, and carrots sauteed in roasted chilli paste."}]}], "section_name"=>"Seafood"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"text"=>"Served with salad, veggie crispy roll, and white rice (brown or fried rice additional 1)", "type"=>"SECTION_TEXT"}, {"text"=>"All noodle dishes excludes rice", "type"=>"SECTION_TEXT"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Rice", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}, {"price"=>"+1.00", "name"=>"Fried rice"}]}, {"text"=>"Meat", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Shrimp"}]}, {"text"=>"Meat", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Chicken"}, {"name"=>"Beef"}, {"name"=>"Pork"}, {"name"=>"Tofu"}]}], "type"=>"ITEM", "name"=>"Panang Curry"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Rice", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}, {"price"=>"+1.00", "name"=>"Fried rice"}]}, {"text"=>"Meat", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Shrimp"}]}, {"text"=>"Meat", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Chicken"}, {"name"=>"Beef"}, {"name"=>"Pork"}, {"name"=>"Tofu"}]}], "type"=>"ITEM", "name"=>"Yellow Curry (Kang Go-Ree)"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Rice", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}, {"price"=>"+1.00", "name"=>"Fried rice"}]}, {"text"=>"Meat", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Shrimp"}]}, {"text"=>"Meat", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Chicken"}, {"name"=>"Beef"}, {"name"=>"Pork"}, {"name"=>"Tofu"}]}], "type"=>"ITEM", "name"=>"Red Curry (Kang-Dang)"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Rice", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}, {"price"=>"+1.00", "name"=>"Fried rice"}]}, {"text"=>"Meat", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Shrimp"}]}, {"text"=>"Meat", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Chicken"}, {"name"=>"Beef"}, {"name"=>"Pork"}, {"name"=>"Tofu"}]}], "type"=>"ITEM", "name"=>"Green Curry"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Rice", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}, {"price"=>"+1.00", "name"=>"Fried rice"}]}, {"text"=>"Meat", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Shrimp"}]}, {"text"=>"Meat", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Chicken"}, {"name"=>"Beef"}, {"name"=>"Pork"}, {"name"=>"Tofu"}]}], "type"=>"ITEM", "name"=>"Spicy Basil Eggplant"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Rice", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}, {"price"=>"+1.00", "name"=>"Fried rice"}]}, {"text"=>"Meat", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Shrimp"}]}, {"text"=>"Meat", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Chicken"}, {"name"=>"Beef"}, {"name"=>"Pork"}, {"name"=>"Tofu"}]}], "type"=>"ITEM", "name"=>"Saucy Broccoli"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Rice", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}, {"price"=>"+1.00", "name"=>"Fried rice"}]}, {"text"=>"Meat", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Shrimp"}]}, {"text"=>"Meat", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Chicken"}, {"name"=>"Beef"}, {"name"=>"Pork"}, {"name"=>"Tofu"}]}], "type"=>"ITEM", "name"=>"Garlic Pepper (Gai-Teum)"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Rice", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}, {"price"=>"+1.00", "name"=>"Fried rice"}]}, {"text"=>"Meat", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Shrimp"}]}, {"text"=>"Meat", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Chicken"}, {"name"=>"Beef"}, {"name"=>"Pork"}, {"name"=>"Tofu"}]}], "type"=>"ITEM", "name"=>"Vegetable Medley"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Rice", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}, {"price"=>"+1.00", "name"=>"Fried rice"}]}, {"text"=>"Meat", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Shrimp"}]}, {"text"=>"Meat", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Chicken"}, {"name"=>"Beef"}, {"name"=>"Pork"}, {"name"=>"Tofu"}]}], "type"=>"ITEM", "name"=>"Teriyaki"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Rice", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}, {"price"=>"+1.00", "name"=>"Fried rice"}]}, {"text"=>"Meat", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Shrimp"}]}, {"text"=>"Meat", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Chicken"}, {"name"=>"Beef"}, {"name"=>"Pork"}, {"name"=>"Tofu"}]}], "type"=>"ITEM", "name"=>"Drunken Noodle"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Rice", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}, {"price"=>"+1.00", "name"=>"Fried rice"}]}, {"text"=>"Meat", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Shrimp"}]}, {"text"=>"Meat", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Chicken"}, {"name"=>"Beef"}, {"name"=>"Pork"}, {"name"=>"Tofu"}]}], "type"=>"ITEM", "name"=>"Pad Thai Noodle"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Rice", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}, {"price"=>"+1.00", "name"=>"Fried rice"}]}, {"text"=>"Meat", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Shrimp"}]}, {"text"=>"Meat", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Chicken"}, {"name"=>"Beef"}, {"name"=>"Pork"}, {"name"=>"Tofu"}]}], "type"=>"ITEM", "name"=>"Pad Se Ew Noodle"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Rice", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}, {"price"=>"+1.00", "name"=>"Fried rice"}]}, {"text"=>"Meat", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Shrimp"}]}, {"text"=>"Meat", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Chicken"}, {"name"=>"Beef"}, {"name"=>"Pork"}, {"name"=>"Tofu"}]}], "type"=>"ITEM", "name"=>"Chow Mein Noodle"}]}], "section_name"=>"Lunch Specials"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"price"=>"3.00", "type"=>"ITEM", "name"=>"Green Tea, Thai Tea, or Coconut Ice Cream"}, {"price"=>"5.50", "type"=>"ITEM", "name"=>"Banana Wrap with Coconut Ice Cream"}, {"price"=>"6.95", "type"=>"ITEM", "name"=>"Mango with Sticky Rice (Seasonal)"}]}], "section_name"=>"Desserts"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"price"=>"1.00", "type"=>"ITEM", "name"=>"White Rice"}, {"price"=>"1.50", "type"=>"ITEM", "name"=>"Brown Rice"}, {"price"=>"2.00", "type"=>"ITEM", "name"=>"Sticky Rice"}, {"price"=>"2.50", "type"=>"ITEM", "name"=>"Garlic Rice"}, {"price"=>"2.50", "type"=>"ITEM", "name"=>"Fried Rice"}, {"price"=>"4.00", "type"=>"ITEM", "name"=>"Steamed", "description"=>"Vegetables"}, {"price"=>"1.00", "type"=>"ITEM", "name"=>"Peanut Sauce"}, {"price"=>"1.00", "type"=>"ITEM", "name"=>"Sweet and Sour Sauce"}]}], "section_name"=>"Sides"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"price"=>"1.25", "type"=>"ITEM", "name"=>"Bottled Water, Coke, Diet Coke, 7-Up, Iced Tea (Refillable), and Jasmine or Green Tea"}, {"price"=>"2.00", "type"=>"ITEM", "name"=>"Thai Iced Tea, Thai Iced Coffee, Lemonade, Apple Juice, Cranberry Juice, and Perrier"}]}], "section_name"=>"Beverages"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"price"=>"5.50", "type"=>"ITEM", "name"=>"Tofu Delight (8)", "description"=>"Deep fried tofu served with a side of crushed peanuts in sweet and sour sauce."}, {"price"=>"5.25", "type"=>"ITEM", "name"=>"Veggie Crispy Egg Roll (4)", "description"=>"Assorted vegetables and cellophane noodle deep fried and served with sweet chili dipping sauce."}, {"price"=>"5.50", "type"=>"ITEM", "name"=>"Crispy Wontons (8)", "description"=>"Ground chicken blended in spices and wrapped in wonton, fried, and served with sweet chili dipping sauce."}, {"price"=>"8.00", "type"=>"ITEM", "name"=>"Shrimp Wontons (12)", "description"=>"Marinated shrimp wrapped in wonton, fried, and served with sweet chili dipping sauce."}, {"price"=>"7.00", "type"=>"ITEM", "name"=>"Shrimp Spring Rolls (3)", "description"=>"Shrimp, fresh vegetables, rice noodles, basil leaves, wrapped in rice paper, and served with peanut sauce blended with a hint of chilli."}, {"price"=>"7.50", "type"=>"ITEM", "name"=>"Satay Sticks", "description"=>"Choices of: chicken, beef, or tofu on skewers, marinated in coconut milk and spices. Served with sides of a peanut sauce and cucumber sauce."}, {"price"=>"7.00", "type"=>"ITEM", "name"=>"Dumplings (Gyozas) (8)", "description"=>"Dumplings filled with chicken and cabbage. Served with sweet soy sauce. Can be served: steamed, fried, or sauteed"}, {"price"=>"8.00", "type"=>"ITEM", "name"=>"Thai Style Spicy Wings (10)", "description"=>"Crispy chicken wings tossed with a combination of chili paste and sweet and sour sauce."}, {"price"=>"9.00", "type"=>"ITEM", "name"=>"Golden Shrimp (8)", "description"=>"Marinated whole shrimp wrapped in bacon, fried, and served with sweet chili dipping sauce."}, {"price"=>"8.50", "type"=>"ITEM", "name"=>"Crispy Calamari", "description"=>"Served with sweet chili dipping sauce."}, {"price"=>"9.95", "type"=>"ITEM", "name"=>"Bamboo Sampler", "description"=>"Combination of 4 golden shrimp, 4 veggie crispy rolls, and 6 crispy wontons."}, {"price"=>"5.25", "type"=>"ITEM", "name"=>"Curry Fries", "description"=>"Fries with yellow or green curry on the side."}]}], "section_name"=>"Appetizers"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"price"=>"5.50", "name"=>"Bowl"}, {"price"=>"7.50", "name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Wonton Soup", "description"=>"Chicken, shrimp, and vegetables in a hearty chicken broth"}, {"option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"price"=>"5.50", "name"=>"Bowl"}, {"price"=>"7.50", "name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Tofu Soup", "description"=>"Chicken, pork, soft tofu, cabbage, celery, onion, mushroom, and carrot"}, {"option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"price"=>"5.50", "name"=>"Bowl"}, {"price"=>"7.50", "name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Noodle Soup", "description"=>"Cellophane noodles, chicken, shrimp, black mushroom, celery, white onion, and scallion cooked in a hearty chicken broth"}, {"option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"price"=>"5.50", "name"=>"Bowl"}, {"price"=>"7.50", "name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Vegetable Soup", "description"=>"Mushroom, napa cabbage, celery, and carrot garnished with fried garlic."}, {"option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"price"=>"5.50", "name"=>"Bowl"}, {"price"=>"7.50", "name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Tom Yum", "description"=>"Spicy lemongrass soup. Chicken, mushroom, lemongrass, galangal, kaffir lime, and roasted chili"}, {"option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"price"=>"6.50", "name"=>"Bowl"}, {"price"=>"8.50", "name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Tom Kah", "description"=>"Spicy coconut soup with lemongrass soup. Chicken, mushrooms, lemongrass, kaffir lime leaves, lime juice, and roasted chili"}, {"price"=>"13.75 Per pot", "type"=>"ITEM", "name"=>"Seafood Soup", "description"=>"Scallops, shrimp, calamari, mussels, crab, and fish fillet with ginger, mushroom, kaffir lime leaves, galanga, lemongrass, roasted chili, and basil."}]}], "section_name"=>"Soup"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"price"=>"7.50", "type"=>"ITEM", "name"=>"Garden Salad", "description"=>"Mixed greens, cucumber, carrot, tomato, celery, bell pepper, sliced boiled egg, served with peanut dressing."}, {"price"=>"7.50", "type"=>"ITEM", "name"=>"Chicken Larb", "description"=>"Ground chicken seasoned with herbs, mint leaves, scallion, shallot, roasted chili, and rice powder, and served with fresh cabbage."}, {"price"=>"9.50", "type"=>"ITEM", "name"=>"Shrimp Salad", "description"=>"Lightly seasoned grilled shrimp, shallot, crispy lettuce, served with roasted chili paste."}, {"price"=>"8.50", "type"=>"ITEM", "name"=>"Beef Salad", "description"=>"Season charbroiled beef, lime juice, onion, tomato, cumber, shallot, scallion, and roasted chili. Served on a bed of fresh greens."}, {"price"=>"8.50", "type"=>"ITEM", "name"=>"Papaya Salad (Som-Tom)", "description"=>"Shaved green papaya, garlic, green beans, tomatoes, peanut, chili, and lime juice dressing topped with grilled shrimp."}]}], "section_name"=>"Salads"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"type"=>"ITEM", "name"=>"Garlic Pepper (Gai-Teum)", "description"=>"Stir-fried with fresh garlic and black peppers with a bed of cabbage and side steamed broccoli."}, {"type"=>"ITEM", "name"=>"Spicy Green Bean (Prik-King)", "description"=>"Thai classic made with roasted chili paste, sauteed with green bean, bell pepper, topped with crispy mint leaves."}, {"type"=>"ITEM", "name"=>"Sweet and Sour", "description"=>"Homemade sweet and sour sauce, cucumber, tomato, onion, pineapple, and bell pepper."}, {"type"=>"ITEM", "name"=>"Saucy Broccoli", "description"=>"Steamed broccoli stir-fried under intense heat with garlic and oyster sauce."}, {"type"=>"ITEM", "name"=>"Spicy Basil Eggplant", "description"=>"Eggplant stir-fried in roasted chili, bell pepper, onions, and sweet basil."}, {"type"=>"ITEM", "name"=>"Cashew Nut", "description"=>"Stir-fried with cashews, roasted dried chili, onion, bell pepper, and green onion."}, {"type"=>"ITEM", "name"=>"Vegetable Medley", "description"=>"Seasonal fresh greens and mushrooms, stir-fried under intense heat in a light garlic sauce"}, {"type"=>"ITEM", "name"=>"Teriyaki", "description"=>"Homemade teriyaki sauce garnished with sesame seed."}, {"type"=>"ITEM", "name"=>"Spicy Mint Leaf (Gra-Pow)", "description"=>"Sweet basil, garlic, chili, onion, carrot, and bell pepper. Or traditional thai style with ground chicken"}]}], "section_name"=>"Entrees"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"type"=>"ITEM", "name"=>"Panang Curry", "description"=>"Blend of red chili, mild chili paste, herbs, spices, bell pepper, peas, carrots, and sweet basil in a coconut cream."}, {"type"=>"ITEM", "name"=>"Yellow Curry (Kang Go-Ree)", "description"=>"Carrots and potatoes in a coconut cream."}, {"type"=>"ITEM", "name"=>"Red Curry (Kang-Dang)", "description"=>"Blend of red chili, herbs, spices, bell peppers, bamboo shoots, and sweet basil in a coconut cream."}, {"type"=>"ITEM", "name"=>"Green Curry (Kang Kew-Wan)", "description"=>"Blend of green chili, herbs, spices, eggplant, bamboo shots, bell pepper, and sweet basil, in a coconut cream."}, {"price"=>"8.50", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Any meat"}, {"price"=>"+2.00", "name"=>"Shrimp"}]}], "type"=>"ITEM", "name"=>"Pineapple Curry", "description"=>"Blend of red chili, herbs, spices, mild chili paste, pineapple, bell pepper, tomatoes, and sweet basil in a coconut cream."}]}], "section_name"=>"Curry"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"type"=>"ITEM", "name"=>"Pad Thai", "description"=>"Thin rice noodles sauteed with egg, green onion, and bean sprouts garnished with crushed peanuts."}, {"type"=>"ITEM", "name"=>"Pad See Ew", "description"=>"Flat rice noodles, sauteed with broccoli in sweet soy sauce."}, {"type"=>"ITEM", "name"=>"Rad-Na", "description"=>"Flat rice noodles, steamed broccoli, in garlic soy gravy."}, {"type"=>"ITEM", "name"=>"Drunken Noodle (Pad Ke Mow)", "description"=>"Flat rice noodle, sauteed with onion, green chili, sweet basil, and garlic chili sauce."}, {"type"=>"ITEM", "name"=>"Pad Woon Sen", "description"=>"Cellophane noodles, sauteed with egg, onion, tomato, black mushroom, green onion, and bean sprouts with sweet soy sauce."}, {"type"=>"ITEM", "name"=>"Chow Mein", "description"=>"Egg noodles sauteed with broccoli, carrot, mushroom, cabbage, baby corn, onion, celery, and bean sprouts."}, {"price"=>"8.50", "type"=>"ITEM", "name"=>"Chicken Noodle (Gai Ku-Ah)", "description"=>"Flat rice noodle sauteed with egg, chicken, calamari, green onion, bean sprouts, and topped with crushed peanuts."}]}], "section_name"=>"Noodles"}], "currency_symbol"=>"$"}, {"menu_name"=>"Menu", "sections"=>[{"subsections"=>[{"subsection_name"=>"", "contents"=>[{"text"=>"Served from 11—3pm daily", "type"=>"SECTION_TEXT"}, {"text"=>"Served with salad, veggie egg roll, and white rice", "type"=>"SECTION_TEXT"}, {"text"=>"All noodle dishes exclude rice", "type"=>"SECTION_TEXT"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Panang Curry"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Yellow Curry"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Red Curry"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Green Curry"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Spicy Basil Eggplant"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Saucy Broccoli with Oyster Sauce"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Garlic Pepper"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Orange Chicken"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Vegetable Medley"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Teriyaki"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Drunken Noodle"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Pad Thai Noodle"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Pad See Ew Noodle"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Chow Mein Noodle"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Cashew Nut"}, {"price"=>"6.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+1.00", "name"=>"Brown rice"}]}], "type"=>"ITEM", "name"=>"Spicy Mint Leaf"}, {"text"=>"All dishes at bamboo thai bistro are served a la carte and do not include rice.We offer five choices of rice to suit your taste buds.All spicy dishes are prepared medium spicy, but can be made less spicy or more spicy by request.Before placing your order, let us know if you have any food allergies.Most dishes can accommodate vegan, vegetarian, and gluten-free diets.", "type"=>"SECTION_TEXT"}, {"text"=>"We accept visa, mastercard, discover, and amex", "type"=>"SECTION_TEXT"}, {"text"=>"There is a 0.50 fee for credit card purchases under 10.for parties of five or more, a 18% gratuity fee will be added.10 corking charge when applicable.Prices and menus are subject to change without notice.We reserve the right to refuse service to anyone.", "type"=>"SECTION_TEXT"}]}], "section_name"=>"Lunch Specials"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"price"=>"5.50", "type"=>"ITEM", "name"=>"Tofu Delight", "description"=>"Deep fried tofu served with a side of crushed peanuts in sweet and sour sauce"}, {"price"=>"5.25", "type"=>"ITEM", "name"=>"Veggie Egg Roll", "description"=>"Assorted vegetables and glass noodles deep fried and served with sweet chili dipping sauce"}, {"price"=>"5.50", "type"=>"ITEM", "name"=>"Crispy Wontons", "description"=>"Ground chicken blended in spices and wrapped in wonton, fried, and served with sweet chili dipping sauce"}, {"price"=>"8.00", "type"=>"ITEM", "name"=>"Shrimp Wonton", "description"=>"Marinated shrimp wrapped in wonton, fried, and served with sweet chili dipping sauce"}, {"price"=>"7.50", "type"=>"ITEM", "name"=>"Shrimp Fresh Rolls", "description"=>"Shrimp, fresh vegetables, basil leaves, wrapped in rice paper and served with peanut sauce with a hint of chili"}, {"price"=>"8.50", "option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Chicken"}, {"name"=>"Beef"}, {"name"=>"Tofu"}, {"name"=>"Marinated in coconut milk and spices"}]}], "type"=>"ITEM", "name"=>"Skewers (Satay)", "description"=>"Served with sides of peanut sauce and cucumber sauce combination choice of two"}, {"price"=>"7.00", "type"=>"ITEM", "name"=>"Dumplings (Gyoza)", "description"=>"Dumplings filled with chicken and cabbage, and served with sweet soy sauce.Served steamed, fried, or pan-fried"}, {"price"=>"8.00", "type"=>"ITEM", "name"=>"Thai Style Spicy Wings", "description"=>"Crispy chicken wings tossed with a combination of chili paste and sweet and sour sauce"}, {"price"=>"9.00", "type"=>"ITEM", "name"=>"Golden Shrimp", "description"=>"Marinated whole shrimp wrapped in bacon, fried, and served with sweet chili dipping sauce"}, {"price"=>"8.50", "type"=>"ITEM", "name"=>"Crispy Calamari", "description"=>"Deep fried calamari served with sweet chili dipping sauce"}, {"price"=>"7.50", "type"=>"ITEM", "name"=>"Fish Cakes", "description"=>"Deep-fried ground fish blended with green bean and red curry paste and served with cucumber salad"}, {"price"=>"9.95", "type"=>"ITEM", "name"=>"Bamboo Sampler", "description"=>"Combination of 4 golden shrimps, 4 crispy rolls, and 6 crispy wontons"}, {"price"=>"8.50", "type"=>"ITEM", "name"=>"Chicken Lettuce Wraps", "description"=>"Wok-seared ground chicken, chili paste, water chestnuts, and cilantro served with crisp lettuce cups"}]}], "section_name"=>"Appetizers"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"price"=>"7.50", "type"=>"ITEM", "name"=>"Garden Salad", "description"=>"Mixed greens, cucumber, carrot, tomato, bell pepper, sliced boiled egg, served with peanut dressing and topped with crispy wontons"}, {"price"=>"7.95", "type"=>"ITEM", "name"=>"Chicken Larb", "description"=>"Ground chicken seasoned with herbs, mint leaves, scallion, shallot, roasted chili, rice powder, and served with fresh cabbage"}, {"price"=>"9.95", "type"=>"ITEM", "name"=>"Shrimp Salad", "description"=>"Lightly seasoned shrimp, shallot, crispy lettuce, served with roasted chili paste"}, {"price"=>"8.95", "type"=>"ITEM", "name"=>"Beef Salad", "description"=>"Seasoned charbroiled beef, lime juice, onion, tomato, cucumber, shallot, and roasted chili served on a bed of fresh greens"}, {"price"=>"8.95", "type"=>"ITEM", "name"=>"Papaya Salad (Som-Tum)", "description"=>"Shaved green papaya, garlic, green beans, tomatoes, peanut, chili, and lime juice dressing topped with grilled shrimp"}]}], "section_name"=>"Salads"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"price"=>"5.50", "name"=>"Bowl"}, {"price"=>"8.50", "name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Wonton Soup", "description"=>"Chicken, shrimp, and vegetables in a hearty chicken broth"}, {"option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"price"=>"5.50", "name"=>"Bowl"}, {"price"=>"8.50", "name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Tofu Soup", "description"=>"Chicken, pork, soft tofu, cabbage, celery, onion, mushroom, and carrot"}, {"option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"price"=>"5.50", "name"=>"Bowl"}, {"price"=>"8.50", "name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Glass Noodle Soup", "description"=>"Chicken, shrimp, mushroom, white onion, and scallion cooked in a hearty chicken broth"}, {"option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"price"=>"5.50", "name"=>"Bowl"}, {"price"=>"8.50", "name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Vegetable Soup", "description"=>"Mushroom, napa cabbage, and carrot, garnished with fried garlic"}, {"option_groups"=>[{"text"=>"Meat", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Shrimp"}]}, {"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"price"=>"5.50", "name"=>"Bowl"}, {"price"=>"8.50", "name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Lemongrass Soup (Tom Yum)", "description"=>"Spicy lemongrass soup with chicken, mushroom, lemongrass, galangal, kaffir lime, and roasted chili"}, {"option_groups"=>[{"text"=>"Meat", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Shrimp"}]}, {"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"price"=>"6.50", "name"=>"Bowl"}, {"price"=>"9.50", "name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Coconut Soup (Tom Kah)", "description"=>"Spicy coconut milk and lemongrass soup with chicken, mushrooms, lemongrass, kaffir lime leaves, lime juice, and roasted chili"}, {"option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"price"=>"n/a", "name"=>"Bowl"}, {"price"=>"14.95", "name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Seafood Lemongrass Soup", "description"=>"Scallops, shrimp, calamari, mussels, crab, and fish fillet with ginger, mushroom, kaffir lime leaves, galangal, lemongrass, roasted chili, and basil"}, {"option_groups"=>[{"text"=>"Serve", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Meat"}, {"name"=>"Tofu"}, {"name"=>"Vegetables"}, {"name"=>"Fried rice and noodles"}]}, {"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"price"=>"n/a", "name"=>"Bowl"}, {"price"=>"15.95", "name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Seafood Coconut Soup", "description"=>"Scallops, shrimp, calamari, mussels, crab, and fish fillet with ginger, mushroom, kaffir lime leaves, galangal, lemongrass, roasted chili, and basil in coconut milk soup"}, {"price"=>"7.95", "option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Bowl"}, {"name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Chicken"}, {"price"=>"7.75", "option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Bowl"}, {"name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Vegetables"}, {"price"=>"7.75", "option_groups"=>[{"text"=>"Served", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Fried"}, {"name"=>"Steamed"}]}, {"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Bowl"}, {"name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Tofu"}, {"price"=>"8.95", "option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Bowl"}, {"name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Beef"}, {"price"=>"8.95", "option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Bowl"}, {"name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Pork"}, {"price"=>"9.95", "option_groups"=>[{"text"=>"Size", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Bowl"}, {"name"=>"Pot"}]}], "type"=>"ITEM", "name"=>"Shrimp"}]}], "section_name"=>"Soups"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"type"=>"ITEM", "name"=>"Thai Fried Rice", "description"=>"Stir-fried with egg, green peas, carrot, and onion"}, {"type"=>"ITEM", "name"=>"Spicy Fried Rice", "description"=>"Stir-fried with garlic, onion, bell pepper, fresh chili, and sweet basil"}, {"type"=>"ITEM", "name"=>"Curry Fried Rice", "description"=>"Stir-fried with a touch of yellow curry powder, egg, onion, green peas, and carrot"}, {"price"=>"9.95", "type"=>"ITEM", "name"=>"Crab Fried Rice", "description"=>"Real and imitation crab, stir-fried with egg, green peas, carrot, and onion"}, {"price"=>"9.95", "type"=>"ITEM", "name"=>"Pineapple Fried Rice", "description"=>"Chicken, shrimp, stir-fried with a touch of curry powder, sauteed egg, cashew nut, raisin, pineapple, and garnished with green onion"}]}], "section_name"=>"Fried Rice"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"type"=>"ITEM", "name"=>"Pad Thai", "description"=>"Thin rice noodles stir-fried with egg, green onion, and served with a side of bean sprouts and crushed peanuts"}, {"type"=>"ITEM", "name"=>"Pad See Ew", "description"=>"Flat rice noodles, stir-fried egg with broccoli in sweet soy sauce"}, {"type"=>"ITEM", "name"=>"Rad-Na", "description"=>"Flat rice noodles, steamed broccoli, in garlic soy gravy"}, {"type"=>"ITEM", "name"=>"Drunken Noodle (Pad Ke Mow)", "description"=>"Flat rice noodle, stir-fried with onion, bell pepper, chili, sweet basil, and garlic chili sauce"}, {"type"=>"ITEM", "name"=>"Silver Noodle (Pad Woon Sen)", "description"=>"Glass noodles, stir-fried with egg, onion, tomato, carrot, cabbage, mushroom, green onion, and bean sprouts with sweet soy sauce"}, {"type"=>"ITEM", "name"=>"Chow Mein", "description"=>"Egg noodles stir-fried with broccoli, carrot, mushroom, cabbage, baby corn, water chestnut, and bean sprouts"}, {"price"=>"8.95", "type"=>"ITEM", "name"=>"Chicken Noodle (Gai Ku-Ah)", "description"=>"Flat rice noodle stir-fried with chicken, calamari, egg, green onion, bean sprouts, and topped with crushed peanuts and fried garlic on a bed of lettuce"}, {"price"=>"9.95", "option_groups"=>[{"text"=>"Serve", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Meat"}, {"name"=>"Tofu"}, {"name"=>"Vegetables"}, {"name"=>"Fried rice and noodles"}]}], "type"=>"ITEM", "name"=>"Kung Pao Spaghetti", "description"=>"Battered deep fried chicken and shrimp with bell peppers and peanuts"}, {"price"=>"7.95", "type"=>"ITEM", "name"=>"Chicken"}, {"price"=>"7.75", "type"=>"ITEM", "name"=>"Vegetables"}, {"price"=>"7.75", "option_groups"=>[{"text"=>"Served", "type"=>"OPTION_CHOOSE", "options"=>[{"name"=>"Fried"}, {"name"=>"Steamed"}]}], "type"=>"ITEM", "name"=>"Tofu"}, {"price"=>"8.95", "type"=>"ITEM", "name"=>"Beef"}, {"price"=>"8.95", "type"=>"ITEM", "name"=>"Pork"}, {"price"=>"9.95", "type"=>"ITEM", "name"=>"Shrimp"}]}], "section_name"=>"Noodles"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"type"=>"ITEM", "name"=>"Garlic Pepper (Gai-Teum)", "description"=>"Stir-fried with fresh garlic and black peppers with a bed of cabbage and side of steamed broccoli"}, {"type"=>"ITEM", "name"=>"Spicy Green Bean (Prik-King)", "description"=>"Thai classic made with roasted chili paste, sauteed with green bean, bell pepper, topped with crispy mint leaves"}, {"type"=>"ITEM", "name"=>"Sweet and Sour", "description"=>"Homemade sweet and sour sauce, cucumber, tomato, onion, pineapple, carrots, green onions and bell pepper"}, {"type"=>"ITEM", "name"=>"Saucy Broccoli", "description"=>"Steamed broccoli stir-fried under intence heat with garlic and oyster sauce"}, {"type"=>"ITEM", "name"=>"Spicy Basil Eggplant", "description"=>"Eggplant stir-fried in roasted chili, bell pepper, onions, and sweet basil"}, {"type"=>"ITEM", "name"=>"Cashew Nut", "description"=>"Stir-fried with cashews, roasted dried chili, onion, bell pepper, carrots, water chestnuts and green onion"}, {"type"=>"ITEM", "name"=>"Vegetable Medley", "description"=>"Carrots, broccoli, onions, water chestnuts, cabbage, napa cabbage, bean sprouts, and baby corn and mushrooms, stir-fried under intense heat in a light garlic sauce"}, {"type"=>"ITEM", "name"=>"Teriyaki", "description"=>"Homemade teriyaki sauce garnished with sesame seed served on a bed of cabbage"}, {"price"=>"8.95", "type"=>"ITEM", "name"=>"Spicy Mint Leaf (Gra-Pow)", "description"=>"Stir-fried with sweet basil, garlic, chili, onion, and bell pepper or traditional thai style with ground chicken"}]}], "section_name"=>"Entrees Curries"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"type"=>"ITEM", "name"=>"Panang Curry", "description"=>"Blend of red chili, mild chili paste, herbs, spices, bell pepper, peas, carrots, and sweet basil in a coconut milk"}, {"type"=>"ITEM", "name"=>"Yellow Curry (Kang Go-Ree)", "description"=>"Carrots and potatoes in a coconut milk"}, {"type"=>"ITEM", "name"=>"Massaman Curry", "description"=>"Curry with potatoes, carrots, onions, and peanuts"}, {"type"=>"ITEM", "name"=>"Red Curry (Kang-Dang)", "description"=>"Blend of red chili, herbs, spices, bell peppers, bamboo shoots, and sweet basil in a coconut milk"}, {"type"=>"ITEM", "name"=>"Green Curry (Kang Kew-Wan)", "description"=>"Blend of green chili, herbs, spices, eggplant, bamboo shoots, bell pepper, and sweet basil in a coconut milk"}, {"price"=>"8.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Meat"}, {"price"=>"+2.00", "name"=>"Shrimp"}]}], "type"=>"ITEM", "name"=>"Pineapple Curry", "description"=>"Blend of red chili, herbs, spices, mild chili paste, pineapple, bell pepper, tomatoes, and sweet basil in a coconut milk"}, {"price"=>"8.95", "option_groups"=>[{"text"=>"Extra", "type"=>"OPTION_ADD", "options"=>[{"price"=>"+2.00", "name"=>"Meat"}, {"price"=>"+2.00", "name"=>"Shrimp"}]}], "type"=>"ITEM", "name"=>"Pumpkin Curry", "description"=>"Bell pepper, basil, and kabocha pumpkin in red curry"}]}], "section_name"=>"Curries"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"price"=>"8.95", "type"=>"ITEM", "name"=>"Thai BBQ Chicken", "description"=>"Chicken marinated in yellow curry powder, turmeric, garlic, coriander, herbs, spices, served with steamed broccoli, and sweet chili sauce"}, {"price"=>"9.95", "type"=>"ITEM", "name"=>"BBQ Pork Ribs", "description"=>"BBQ pork spare ribs marinated in tomato sauce, honey, and a hint of ground black pepper"}, {"price"=>"8.96", "type"=>"ITEM", "name"=>"Orange Chicken", "description"=>"Crispy battered chicken in sweet tangy orange-cherry tomato sauce and garnished with sesame seeds"}, {"price"=>"7.75", "type"=>"ITEM", "name"=>"Crispy Orange Tofu", "description"=>"Crispy fried tofu in our sweet tangy orange-cherry tomato sauce"}, {"price"=>"8.95", "type"=>"ITEM", "name"=>"Spinach with Peanut Sauce", "description"=>"Choice of chicken or tofu.Scallion, cashews, cucumber, served over spinach topped with peanut sauce served on a hot plate"}, {"price"=>"9.95", "type"=>"ITEM", "name"=>"Garlic Spare Ribs", "description"=>"Stir-fried with fresh garlic and black peppers with a bed of cabbage and side of steamed broccoli and carrots"}]}], "section_name"=>"Assorted Dishes"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"price"=>"11.95", "type"=>"ITEM", "name"=>"Shrimp with Chili", "description"=>"Shrimp sautéed with chili paste, and served with steamed vegetables"}, {"price"=>"14.95", "type"=>"ITEM", "name"=>"Crispy Trout", "description"=>"Whole fish seasoned with herbs, spices, served with green apple, cashews, onion, cucumbers, and lime juice"}, {"price"=>"14.95", "type"=>"ITEM", "name"=>"Spicy Mint Shrimp and Scallops", "description"=>"Stir-fried with sweet basil, onion, and bell pepper in savory chili sauce"}, {"price"=>"14.95", "type"=>"ITEM", "name"=>"Yellow Curry Combination Seafood", "description"=>"Shrimp, calamari, scallops, mussels, crab, fillet, egg, carrot, bell peppers and green onion sauteed in yellow curry powder"}, {"price"=>"14.95", "type"=>"ITEM", "name"=>"Supreme Seafood", "description"=>"Shrimp, calamari, scallops, mussels, crab, fillet, sweet basil, onion, bell pepper, and carrots sauteed in roasted chili paste"}, {"price"=>"9.95", "type"=>"ITEM", "name"=>"3 Flavor Fish", "description"=>"Crispy sole fish with spicy, sweet, and sour sauce.Stir-fried with garlic, chili, bell peppers, basil and onions"}]}], "section_name"=>"Seafood"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"price"=>"1.00", "type"=>"ITEM", "name"=>"White Rice"}, {"price"=>"1.50", "type"=>"ITEM", "name"=>"Brown Rice"}, {"price"=>"2.50", "type"=>"ITEM", "name"=>"Sticky Rice"}, {"price"=>"2.50", "type"=>"ITEM", "name"=>"Garlic Rice"}, {"price"=>"2.50", "type"=>"ITEM", "name"=>"Fried Rice"}, {"price"=>"4.00", "type"=>"ITEM", "name"=>"Steamed Vegetables"}, {"price"=>"1.00", "type"=>"ITEM", "name"=>"Peanut Sauce"}, {"price"=>"1.00", "type"=>"ITEM", "name"=>"Sweet and Sour Sauce"}]}], "section_name"=>"Sides"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"price"=>"1.25", "type"=>"ITEM", "name"=>"Bottled Water"}, {"price"=>"1.25", "type"=>"ITEM", "name"=>"Coke, Diet Coke, Sprite,"}, {"price"=>"1.25", "type"=>"ITEM", "name"=>"A&W Root Beer"}, {"price"=>"2.00", "type"=>"ITEM", "name"=>"Jasmine or Green Tea"}, {"price"=>"2.00", "type"=>"ITEM", "name"=>"Lemonade", "description"=>"Non-refillable"}, {"price"=>"2.50", "type"=>"ITEM", "name"=>"Arnold Palmer", "description"=>"Non-refillable"}, {"price"=>"2.00", "type"=>"ITEM", "name"=>"Apple Juice"}, {"price"=>"2.00", "type"=>"ITEM", "name"=>"Cranberry Juice"}, {"price"=>"2.50", "type"=>"ITEM", "name"=>"Pellegrino"}, {"price"=>"2.00", "type"=>"ITEM", "name"=>"Herbal Drinks", "description"=>"Lemongrass, bael, goto kola, roselle, or ginger"}, {"price"=>"2.00", "type"=>"ITEM", "name"=>"Iced Tea", "description"=>"Refillable"}, {"price"=>"2.50", "type"=>"ITEM", "name"=>"Iced Green Tea", "description"=>"Non-refillable"}, {"price"=>"2.50", "type"=>"ITEM", "name"=>"Thai Iced Tea"}, {"price"=>"2.50", "type"=>"ITEM", "name"=>"Thai Iced Coffee"}, {"price"=>"3.50", "type"=>"ITEM", "name"=>"Fresh Young Coconut"}]}], "section_name"=>"Beverages"}, {"subsections"=>[{"subsection_name"=>"", "contents"=>[{"price"=>"3.00", "type"=>"ITEM", "name"=>"Green Tea or Coconut", "description"=>"Ice cream"}, {"price"=>"5.50", "type"=>"ITEM", "name"=>"Fried Banana Wrap", "description"=>"With coconut ice cream"}, {"price"=>"6.95", "type"=>"ITEM", "name"=>"Mango with Sticky Rice (Seasonal)"}, {"price"=>"5.00", "type"=>"ITEM", "name"=>"Cheesecake", "description"=>"With chocolate and caramel drizzle"}, {"price"=>"5.00", "type"=>"ITEM", "name"=>"Tiramisu"}, {"price"=>"5.95", "type"=>"ITEM", "name"=>"Tempura Green Tea Ice Cream"}]}], "section_name"=>"Desserts"}], "currency_symbol"=>"$"}], "locu_id"=>"45d336c20afe6c39abc2", "name"=>"Bamboo Thai Bistro"}]}
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
RSpec.configure do |config|
|
52
|
+
config.include RspecHelpers
|
53
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
include Rlocu
|
2
|
+
require 'config_rlocu_spec_helper'
|
3
|
+
|
4
|
+
RSpec.describe VenueQuery, '#new' do
|
5
|
+
it 'should raise ArgumentError unless query_fields is a hash' do
|
6
|
+
expect{ VenueQuery.new(query_fields: 'spec', return_fields: ['spec']) }.to raise_error(ArgumentError)
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'should raise ArgumentError unless return_fields is an array' do
|
10
|
+
expect{ VenueQuery.new(query_fields: {field: 'spec'}, return_fields: 'spec') }.to raise_error(ArgumentError)
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should raise ArgumentError if return_fields is empty' do
|
14
|
+
expect{ VenueQuery.new(query_fields: {field: 'spec'}, return_fields: []) }.to raise_error(ArgumentError)
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should raise ArgumentError if query_fields is empty' do
|
18
|
+
expect{ VenueQuery.new(query_fields: {}, return_fields: ['spec']) }.to raise_error(ArgumentError)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
RSpec.describe VenueQuery, '#query', type: :integration do
|
23
|
+
it 'should return an array of venues' do
|
24
|
+
key_value_conditions = [QueryBuilder::KeyValueCondition.new(key: 'locu_id', value: '45d336c20afe6c39abc2')]
|
25
|
+
query_conditions = [QueryBuilder::QueryCondition.new(key_value_conditions: key_value_conditions)]
|
26
|
+
venue_query = VenueQuery.new(query_conditions: query_conditions, return_fields: ['locu_id', 'name', 'menus'])
|
27
|
+
expect(venue_query.query).not_to be_empty
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
include Rlocu
|
2
|
+
require 'config_rlocu_spec_helper'
|
3
|
+
|
4
|
+
RSpec.describe VenueSearch, '#with_menus' do
|
5
|
+
it 'returns itself' do
|
6
|
+
venue_search = VenueSearch.new
|
7
|
+
expect(venue_search.with_menus).to eq(venue_search)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
|
12
|
+
RSpec.describe VenueSearch, '#in_lat_long_radius' do
|
13
|
+
it 'returns itself' do
|
14
|
+
venue_search = VenueSearch.new
|
15
|
+
expect(venue_search.in_lat_long_radius(lat: 1, long: 1, radius: 1)).to eq(venue_search)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
RSpec.describe VenueSearch, '#locu_id' do
|
20
|
+
it 'returns itself' do
|
21
|
+
venue_search = VenueSearch.new
|
22
|
+
expect(venue_search.locu_id('spec')).to eq(venue_search)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
RSpec.describe VenueSearch, '#name' do
|
27
|
+
it 'returns itself' do
|
28
|
+
venue_search = VenueSearch.new
|
29
|
+
expect(venue_search.name('spec')).to eq(venue_search)
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,16 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rlocu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Stephen Philp
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
11
|
+
date: 2016-06-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rest-client
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
14
41
|
description: A simple ruby wrapper for the Locu API
|
15
42
|
email:
|
16
43
|
- stephen@stephenphilp.com
|
@@ -18,54 +45,61 @@ executables: []
|
|
18
45
|
extensions: []
|
19
46
|
extra_rdoc_files: []
|
20
47
|
files:
|
21
|
-
- .gitignore
|
48
|
+
- ".gitignore"
|
49
|
+
- ".rspec"
|
22
50
|
- Gemfile
|
23
51
|
- LICENSE.txt
|
24
52
|
- README.md
|
25
53
|
- Rakefile
|
26
54
|
- lib/rlocu.rb
|
27
|
-
- lib/rlocu/
|
55
|
+
- lib/rlocu/geo_json.rb
|
28
56
|
- lib/rlocu/menu.rb
|
57
|
+
- lib/rlocu/query_builder.rb
|
58
|
+
- lib/rlocu/utilities/lat_long_radius.rb
|
29
59
|
- lib/rlocu/venue.rb
|
30
|
-
- lib/rlocu/
|
60
|
+
- lib/rlocu/venue_query.rb
|
31
61
|
- lib/rlocu/venue_search.rb
|
32
62
|
- lib/rlocu/version.rb
|
33
|
-
- lib/utilities.rb
|
34
63
|
- rlocu.gemspec
|
35
|
-
-
|
36
|
-
-
|
37
|
-
-
|
38
|
-
-
|
39
|
-
-
|
64
|
+
- spec/config_rlocu_spec_helper.rb
|
65
|
+
- spec/geo_json_spec.rb
|
66
|
+
- spec/menu/item_spec.rb
|
67
|
+
- spec/menu/menu_item_spec.rb
|
68
|
+
- spec/menu/option_group_spec.rb
|
69
|
+
- spec/menu/option_spec.rb
|
70
|
+
- spec/menu/section_spec.rb
|
71
|
+
- spec/menu/section_text_spec.rb
|
72
|
+
- spec/menu/subsection_spec.rb
|
73
|
+
- spec/menu_spec.rb
|
74
|
+
- spec/query/key_value_condition_spec.rb
|
75
|
+
- spec/spec_helper.rb
|
76
|
+
- spec/support/rspec_helpers.rb
|
77
|
+
- spec/utilities/lat_long_radius_spec.rb
|
78
|
+
- spec/venue_query_spec.rb
|
79
|
+
- spec/venue_search_spec.rb
|
40
80
|
homepage: https://github.com/swelltrain/rlocu
|
41
81
|
licenses: []
|
82
|
+
metadata: {}
|
42
83
|
post_install_message:
|
43
84
|
rdoc_options: []
|
44
85
|
require_paths:
|
45
86
|
- lib
|
46
87
|
required_ruby_version: !ruby/object:Gem::Requirement
|
47
|
-
none: false
|
48
88
|
requirements:
|
49
|
-
- -
|
89
|
+
- - ">="
|
50
90
|
- !ruby/object:Gem::Version
|
51
91
|
version: '0'
|
52
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
|
-
none: false
|
54
93
|
requirements:
|
55
|
-
- -
|
94
|
+
- - ">="
|
56
95
|
- !ruby/object:Gem::Version
|
57
96
|
version: '0'
|
58
97
|
requirements: []
|
59
98
|
rubyforge_project:
|
60
|
-
rubygems_version:
|
99
|
+
rubygems_version: 2.2.2
|
61
100
|
signing_key:
|
62
|
-
specification_version:
|
101
|
+
specification_version: 4
|
63
102
|
summary: Rlocu is a ruby wrapper for Locu's API. The Locu API gives you access to
|
64
103
|
real-time local business data, from opening hours to price lists, such as restaurant
|
65
104
|
menus.
|
66
|
-
test_files:
|
67
|
-
- test/test_truth.rb
|
68
|
-
- test/test_utilities.rb
|
69
|
-
- test/test_venue.rb
|
70
|
-
- test/test_venue_details.rb
|
71
|
-
- test/test_venue_search.rb
|
105
|
+
test_files: []
|
data/lib/rlocu/config.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'yaml'
|
2
|
-
module Rlocu
|
3
|
-
|
4
|
-
class << self
|
5
|
-
|
6
|
-
def config!(file=File.expand_path("../../../.config", __FILE__))
|
7
|
-
configs = YAML::load(File.open(file))
|
8
|
-
@api_key = configs['API_KEY']
|
9
|
-
@http_base = configs['HTTP_BASE']
|
10
|
-
end
|
11
|
-
|
12
|
-
def api_key
|
13
|
-
@api_key
|
14
|
-
end
|
15
|
-
|
16
|
-
def http_base
|
17
|
-
@http_base
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
config!
|
23
|
-
end
|
data/lib/rlocu/venue_details.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'open-uri'
|
2
|
-
require 'JSON'
|
3
|
-
|
4
|
-
module Rlocu
|
5
|
-
module VenueDetails
|
6
|
-
|
7
|
-
def self.query(venues, &block)
|
8
|
-
response = {}
|
9
|
-
open(url(venues)) { |request| response = JSON.parse(request.read) }
|
10
|
-
# should we update the venues passed in or should we create new venue
|
11
|
-
# objects with the updated info? lets create new ones
|
12
|
-
|
13
|
-
venues_w_details = []
|
14
|
-
response['objects'].each do |object|
|
15
|
-
venues_w_details << Venue.new(object)
|
16
|
-
end
|
17
|
-
venues_w_details.each { |venue| yield venue } if block_given?
|
18
|
-
return venues_w_details
|
19
|
-
end
|
20
|
-
|
21
|
-
private
|
22
|
-
|
23
|
-
def self.url(venues)
|
24
|
-
ids = reduce_ids(venues)
|
25
|
-
"#{Rlocu.http_base}venue/#{ids}/?#{Rlocu.encode}"
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.reduce_ids(venues)
|
29
|
-
raise ArgumentError.new "Only 5 venues can be queried at a time for venue details" if venues.count > 5
|
30
|
-
ids = venues.reduce('') {|memo, venue| memo << "#{venue.id};"}
|
31
|
-
ids.chop
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
data/lib/utilities.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
require 'open-uri'
|
2
|
-
|
3
|
-
module Rlocu
|
4
|
-
|
5
|
-
def self.encode(params={})
|
6
|
-
s = params.reduce("api_key=#{Rlocu.api_key}&") {|memo,(key,val)| memo << "#{key.to_s}=#{val}&"}
|
7
|
-
URI::encode(s.chop)
|
8
|
-
end
|
9
|
-
|
10
|
-
class Location
|
11
|
-
attr_accessor :lat, :long
|
12
|
-
|
13
|
-
def initialize(lat, long)
|
14
|
-
if !lat.is_a?(Numeric) || !long.is_a?(Numeric)
|
15
|
-
raise ArgumentError.new "Lat and long must be numeric (floats)"
|
16
|
-
end
|
17
|
-
@lat = lat
|
18
|
-
@long = long
|
19
|
-
end
|
20
|
-
|
21
|
-
def to_s
|
22
|
-
"#{lat},#{long}"
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
|
27
|
-
class Bounds
|
28
|
-
|
29
|
-
def initialize(loc1, loc2)
|
30
|
-
@loc1 = loc1
|
31
|
-
@loc2 = loc2
|
32
|
-
end
|
33
|
-
|
34
|
-
def to_s
|
35
|
-
"#{@loc1.to_s}|#{@loc2.to_s}"
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|