Class: Mappru::Client
- Inherits:
-
Object
- Object
- Mappru::Client
- Includes:
- Logger::Helper, Utils::Helper
- Defined in:
- lib/mappru/client.rb
Instance Method Summary collapse
- #apply(file) ⇒ Object
- #export ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #vpc_name_by_id(vpc_id) ⇒ Object
Methods included from Utils::Helper
Methods included from Logger::Helper
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 |
# File 'lib/mappru/client.rb', line 5 def initialize( = {}) = @client = [:client] || Aws::EC2::Client.new @resource = Aws::EC2::Resource.new(client: @client) @driver = Mappru::Driver.new(@client, ) end |
Instance Method Details
#apply(file) ⇒ Object
21 22 23 |
# File 'lib/mappru/client.rb', line 21 def apply(file) walk(file) end |
#export ⇒ Object
12 13 14 |
# File 'lib/mappru/client.rb', line 12 def export Mappru::Exporter.export(@client, ) end |
#vpc_name_by_id(vpc_id) ⇒ Object
16 17 18 19 |
# File 'lib/mappru/client.rb', line 16 def vpc_name_by_id(vpc_id) name_tag = @resource.vpc(vpc_id)..find {|i| i.key == 'Name' } || {} name_tag[:value] end |