Class: Dynamic53::Cli
- Inherits:
-
Object
- Object
- Dynamic53::Cli
- Defined in:
- lib/dynamic53/cli.rb
Instance Attribute Summary collapse
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#local_ip ⇒ Object
writeonly
Sets the attribute local_ip.
-
#record ⇒ Object
writeonly
Sets the attribute record.
-
#route53 ⇒ Object
writeonly
Sets the attribute route53.
-
#update_hostname ⇒ Object
Returns the value of attribute update_hostname.
-
#user ⇒ Object
Returns the value of attribute user.
-
#zone ⇒ Object
writeonly
Sets the attribute zone.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params) ⇒ Cli
constructor
A new instance of Cli.
- #update_dns ⇒ Object
Constructor Details
#initialize(params) ⇒ Cli
Returns a new instance of Cli.
10 11 12 13 14 15 |
# File 'lib/dynamic53/cli.rb', line 10 def initialize(params) @user = params[0] @hostname = params[1] @update_hostname = params[2] ? params[2] : stringify_computer update_dns end |
Instance Attribute Details
#hostname ⇒ Object
Returns the value of attribute hostname.
8 9 10 |
# File 'lib/dynamic53/cli.rb', line 8 def hostname @hostname end |
#local_ip=(value) ⇒ Object
Sets the attribute local_ip
8 9 10 |
# File 'lib/dynamic53/cli.rb', line 8 def local_ip=(value) @local_ip = value end |
#record=(value) ⇒ Object
Sets the attribute record
8 9 10 |
# File 'lib/dynamic53/cli.rb', line 8 def record=(value) @record = value end |
#route53=(value) ⇒ Object
Sets the attribute route53
8 9 10 |
# File 'lib/dynamic53/cli.rb', line 8 def route53=(value) @route53 = value end |
#update_hostname ⇒ Object
Returns the value of attribute update_hostname.
8 9 10 |
# File 'lib/dynamic53/cli.rb', line 8 def update_hostname @update_hostname end |
#user ⇒ Object
Returns the value of attribute user.
8 9 10 |
# File 'lib/dynamic53/cli.rb', line 8 def user @user end |
#zone=(value) ⇒ Object
Sets the attribute zone
8 9 10 |
# File 'lib/dynamic53/cli.rb', line 8 def zone=(value) @zone = value end |
Class Method Details
.start(params) ⇒ Object
4 5 6 |
# File 'lib/dynamic53/cli.rb', line 4 def self.start(params) new(params) end |
Instance Method Details
#update_dns ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/dynamic53/cli.rb', line 17 def update_dns if record record.update(nil,nil,nil,[local_ip]) else create_record end end |