Module: Eaglenube::CloudObjectMapper::AWS

Instance Method Summary collapse

Instance Method Details

#cloud_obj_mapper(**options) ⇒ Object



19
20
21
# File 'lib/eaglenube/cloud_object_mapper/aws.rb', line 19

def cloud_obj_mapper(**options)
  @attr_map = options
end

#cloud_obj_mapper_yml(file_path) ⇒ Object

Raises:

  • (StandardError)


8
9
10
11
12
13
14
15
16
17
# File 'lib/eaglenube/cloud_object_mapper/aws.rb', line 8

def cloud_obj_mapper_yml(file_path)
  raise StandardError, "#{file_path} not found." unless File.exist?(file_path)

  @attr_map = begin
    YAML.safe_load(File.open(file_path)).symbolize_keys
  rescue StandardError => e
    puts e.message
    {}
  end
end

#parse_provider_data(obj) ⇒ Object



23
24
25
# File 'lib/eaglenube/cloud_object_mapper/aws.rb', line 23

def parse_provider_data(obj)
  @attr_map.transform_values { |v| eval v }
end