Class: FreeboxApi::Resources::LanHost
- Inherits:
-
Object
- Object
- FreeboxApi::Resources::LanHost
- Defined in:
- lib/freebox_api/resources/lan_host.rb
Instance Method Summary collapse
- #index ⇒ Object
-
#initialize(session) ⇒ LanHost
constructor
A new instance of LanHost.
- #show(id, interface = 'pub') ⇒ Object
- #update(params = {}, interface = 'pub') ⇒ Object
Constructor Details
#initialize(session) ⇒ LanHost
Returns a new instance of LanHost.
7 8 9 |
# File 'lib/freebox_api/resources/lan_host.rb', line 7 def initialize(session) @session = session end |
Instance Method Details
#index ⇒ Object
11 12 13 14 15 |
# File 'lib/freebox_api/resources/lan_host.rb', line 11 def index Interface.new(@session).index.collect { |interface| @session.http_call('get', "/lan/browser/#{interface['name']}") }.flatten end |
#show(id, interface = 'pub') ⇒ Object
17 18 19 |
# File 'lib/freebox_api/resources/lan_host.rb', line 17 def show(id, interface = 'pub') @session.http_call('get', "/lan/browser/#{interface}/#{id}/") end |
#update(params = {}, interface = 'pub') ⇒ Object
21 22 23 |
# File 'lib/freebox_api/resources/lan_host.rb', line 21 def update(params = {}, interface = 'pub') @session.http_call('put', "/lan/browser/#{interface}/#{params['id']}", params) end |