Class: Knife::Clc::IpAssignment::IpAssigner
- Inherits:
-
Object
- Object
- Knife::Clc::IpAssignment::IpAssigner
- Defined in:
- lib/knife-clc/ip_assignment/ip_assigner.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#execute(server_id) ⇒ Object
TODO: Params ordering dependency.
-
#initialize(params) ⇒ IpAssigner
constructor
A new instance of IpAssigner.
- #prepare ⇒ Object
Constructor Details
#initialize(params) ⇒ IpAssigner
Returns a new instance of IpAssigner.
10 11 12 13 14 |
# File 'lib/knife-clc/ip_assignment/ip_assigner.rb', line 10 def initialize(params) @connection = params.fetch(:connection) @config = params.fetch(:config) @errors = params.fetch(:errors) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/knife-clc/ip_assignment/ip_assigner.rb', line 8 def config @config end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
8 9 10 |
# File 'lib/knife-clc/ip_assignment/ip_assigner.rb', line 8 def connection @connection end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
8 9 10 |
# File 'lib/knife-clc/ip_assignment/ip_assigner.rb', line 8 def errors @errors end |
Instance Method Details
#execute(server_id) ⇒ Object
TODO: Params ordering dependency
17 18 19 |
# File 'lib/knife-clc/ip_assignment/ip_assigner.rb', line 17 def execute(server_id) connection.create_ip_address(server_id, ip_params) end |
#prepare ⇒ Object
21 22 23 |
# File 'lib/knife-clc/ip_assignment/ip_assigner.rb', line 21 def prepare validator.validate end |