Class: Standup::EC2::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/standup/ec2/base.rb

Direct Known Subclasses

ElasticIP, Instance, SecurityGroup, Volume

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(info = false) ⇒ Base

Returns a new instance of Base.



4
5
6
7
8
9
10
11
12
13
# File 'lib/standup/ec2/base.rb', line 4

def initialize info = false
  case info
    when Hash
      set_info info
    when true
      load_info
    when false
      # nothing
  end
end

Class Method Details

.info_reader(*names) ⇒ Object



15
16
17
18
19
# File 'lib/standup/ec2/base.rb', line 15

def self.info_reader *names
  names.each do |name|
    class_eval "def #{name}; read_info_field :#{name}; end", __FILE__, __LINE__
  end
end

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/standup/ec2/base.rb', line 21

def exists?
  read_info_field :exists
end

#load_infoObject



25
# File 'lib/standup/ec2/base.rb', line 25

def load_info; end