Class: ActiveInTime::SiteProxy
- Inherits:
-
Object
- Object
- ActiveInTime::SiteProxy
- Defined in:
- lib/ait_connect/site_proxy.rb
Instance Method Summary collapse
- #find(id) ⇒ Object
-
#initialize(active_in_time) ⇒ SiteProxy
constructor
A new instance of SiteProxy.
- #nearby(options = {}) ⇒ Object
Constructor Details
#initialize(active_in_time) ⇒ SiteProxy
Returns a new instance of SiteProxy.
3 4 5 |
# File 'lib/ait_connect/site_proxy.rb', line 3 def initialize(active_in_time) @active_in_time = active_in_time end |
Instance Method Details
#find(id) ⇒ Object
7 8 9 |
# File 'lib/ait_connect/site_proxy.rb', line 7 def find(id) ActiveInTime::Site.new(@active_in_time, @active_in_time.get("sites/#{id}")) end |
#nearby(options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/ait_connect/site_proxy.rb', line 11 def nearby(={}) raise ArgumentError, "You must include :ll" unless [:ll] sites = [] response = @active_in_time.get('sites', ).each do |site_json| sites << ActiveInTime::Site.new(@active_in_time, site_json) end sites end |