Class: FreeboxApi::Config
- Inherits:
-
Object
- Object
- FreeboxApi::Config
- Defined in:
- lib/freebox_api/config.rb
Instance Method Summary collapse
-
#initialize(session) ⇒ Config
constructor
A new instance of Config.
- #show(service) ⇒ Object
- #update(service, params = {}) ⇒ Object
- #url(service) ⇒ Object
Constructor Details
#initialize(session) ⇒ Config
Returns a new instance of Config.
5 6 7 |
# File 'lib/freebox_api/config.rb', line 5 def initialize(session) @session = session end |
Instance Method Details
#show(service) ⇒ Object
24 25 26 |
# File 'lib/freebox_api/config.rb', line 24 def show(service) @session.http_call('get', url(service)) end |
#update(service, params = {}) ⇒ Object
28 29 30 |
# File 'lib/freebox_api/config.rb', line 28 def update(service, params = {}) @session.http_call('put', url(service), params) end |
#url(service) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/freebox_api/config.rb', line 9 def url(service) case service when 'ipv6' '/connection/ipv6/config/' when /^ddns\// "/connection/#{service}/" when 'dmz' '/fw/dmz/' when 'samba', 'afp' '/netshare/samba/' else "/#{service}/config/" end end |