Class: FreeboxApi::Configuration::Connection::DDNS
- Inherits:
-
Object
- Object
- FreeboxApi::Configuration::Connection::DDNS
- Defined in:
- lib/freebox_api/configuration/connection.rb
Class Method Summary collapse
- .getConfig(session, provider) ⇒ Object
- .getStatus(session, provider) ⇒ Object
- .updateConfig(session, provider, value) ⇒ Object
Instance Method Summary collapse
- #config ⇒ Object
- #config=(value) ⇒ Object
-
#initialize(session, provider) ⇒ DDNS
constructor
A new instance of DDNS.
- #status ⇒ Object
Constructor Details
#initialize(session, provider) ⇒ DDNS
Returns a new instance of DDNS.
33 34 35 36 37 |
# File 'lib/freebox_api/configuration/connection.rb', line 33 def initialize(session, provider) # TODO: validate that provider matches (ovh|dyndns|noip) @session = session @provider = provider end |
Class Method Details
.getConfig(session, provider) ⇒ Object
47 48 49 |
# File 'lib/freebox_api/configuration/connection.rb', line 47 def self.getConfig(session, provider) session.http_call('get', "/connection/ddns/#{provider}/") end |
.getStatus(session, provider) ⇒ Object
39 40 41 |
# File 'lib/freebox_api/configuration/connection.rb', line 39 def self.getStatus(session, provider) session.http_call('get', "/connection/ddns/#{provider}/status/") end |
.updateConfig(session, provider, value) ⇒ Object
55 56 57 |
# File 'lib/freebox_api/configuration/connection.rb', line 55 def self.updateConfig(session, provider, value) session.http_call('put', "/connection/ddns/#{provider}/", value) end |
Instance Method Details
#config ⇒ Object
51 52 53 |
# File 'lib/freebox_api/configuration/connection.rb', line 51 def config self.class.getConfig(@session, @provider) end |
#config=(value) ⇒ Object
59 60 61 |
# File 'lib/freebox_api/configuration/connection.rb', line 59 def config=(value) self.class.updateConfig(@session, @provider, value) end |
#status ⇒ Object
43 44 45 |
# File 'lib/freebox_api/configuration/connection.rb', line 43 def status self.class.getStatus(@session, @provider) end |