Class: Dynamic53::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamic53/cli.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#hostnameObject

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

Parameters:

  • the value to set the attribute local_ip to.



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

Parameters:

  • the value to set the attribute record to.



8
9
10
# File 'lib/dynamic53/cli.rb', line 8

def record=(value)
  @record = value
end

#route53=(value) ⇒ Object

Sets the attribute route53

Parameters:

  • the value to set the attribute route53 to.



8
9
10
# File 'lib/dynamic53/cli.rb', line 8

def route53=(value)
  @route53 = value
end

#update_hostnameObject

Returns the value of attribute update_hostname.



8
9
10
# File 'lib/dynamic53/cli.rb', line 8

def update_hostname
  @update_hostname
end

#userObject

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

Parameters:

  • the value to set the attribute zone to.



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_dnsObject



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