class AwsInstanceList::Base

Attributes

client[RW]
metric[RW]
region[RW]

Public Class Methods

new(region: 'eu-west-1') click to toggle source
# File lib/aws_instance_list/base.rb, line 9
def initialize region: 'eu-west-1'

  @region=region

  @metric = AwsInstanceList::Metric.new region: region

  @instances = []

end

Public Instance Methods

demodulize() click to toggle source
# File lib/aws_instance_list/base.rb, line 42
def demodulize
  self.class.name.split('::').last
end
instances(options={}) click to toggle source
# File lib/aws_instance_list/base.rb, line 19
def instances options={}
  ds=descriptions(options)
  @instances+=ds.send( list_method )
  if ds.marker
    options[:marker]=ds.marker
    instances(options)
  else
    @instances
  end
end
yaml() click to toggle source
# File lib/aws_instance_list/base.rb, line 30
def yaml
  @yaml||=yaml_default.merge(yaml_file)[demodulize]
end
yaml_default() click to toggle source
# File lib/aws_instance_list/base.rb, line 34
def yaml_default
  YAML.load_file AwsInstanceList::DEFAULT_SETTINGS
end
yaml_file() click to toggle source
# File lib/aws_instance_list/base.rb, line 38
def yaml_file
  ENV.has_key?('AWS_INSTANCE_LIST_YAML') ? YAML.load_file(ENV['AWS_INSTANCE_LIST_YAML']) : {}
end