Class: AMI::Core

Inherits:
Object
  • Object
show all
Defined in:
lib/ami/core.rb

Class Method Summary collapse

Class Method Details

.all_amisObject



21
22
23
# File 'lib/ami/core.rb', line 21

def self.all_amis
  @amis
end

.ami(name) ⇒ Object



17
18
19
# File 'lib/ami/core.rb', line 17

def self.ami(name)
  @amis[name]
end

.load_amisObject



5
6
7
# File 'lib/ami/core.rb', line 5

def self.load_amis
  Dir[Dir.pwd + '/ami/*.rb'].each { |file| require file }
end

.register_ami(subclass) ⇒ Object



9
10
11
# File 'lib/ami/core.rb', line 9

def self.register_ami(subclass)
  @amis[subclass.name] = subclass
end

.valid_ami?(name) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/ami/core.rb', line 13

def self.valid_ami?(name)
  !!@amis[name]
end