Class: VagrantPlugins::Route53NG::Action::SetIp
- Inherits:
-
IpOperations
- Object
- IpOperations
- VagrantPlugins::Route53NG::Action::SetIp
- Defined in:
- lib/vagrant-aws-route53-ng/action/set_ip.rb
Instance Method Summary collapse
- #call(environment) ⇒ Object
-
#initialize(app, environment) ⇒ SetIp
constructor
A new instance of SetIp.
Constructor Details
#initialize(app, environment) ⇒ SetIp
Returns a new instance of SetIp.
8 9 10 |
# File 'lib/vagrant-aws-route53-ng/action/set_ip.rb', line 8 def initialize(app, environment) @app = app end |
Instance Method Details
#call(environment) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/vagrant-aws-route53-ng/action/set_ip.rb', line 12 def call(environment) access_key_id, hosted_zone_id, instance_id, record_set, ip_type, region, secret_access_key = config(environment) return @app.call(environment) \ if hosted_zone_id.eql?(::Vagrant::Plugin::V2::Config::UNSET_VALUE) || record_set.eql?(::Vagrant::Plugin::V2::Config::UNSET_VALUE) set( access_key_id: access_key_id, secret_access_key: secret_access_key, region: region, instance_id: instance_id, hosted_zone_id: hosted_zone_id, record_set: record_set, ip_type: ip_type ) do |instance_id, ip, record_set| environment[:ui].info("#{instance_id}'s #{ip} has been assigned to #{record_set[0]}[#{record_set[1]}]") end @app.call(environment) end |