Class: Instalatron::ScriptConfig

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

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args, &block) ⇒ Object



26
27
28
# File 'lib/instalatron.rb', line 26

def method_missing(symbol, *args, &block)
  ScriptConfig.config[symbol] = args[0]
end

Class Attribute Details

.configObject (readonly)

Returns the value of attribute config.



14
15
16
# File 'lib/instalatron.rb', line 14

def config
  @config
end

Class Method Details

.[](arg) ⇒ Object



16
17
18
# File 'lib/instalatron.rb', line 16

def [](arg)
  config[arg]
end

.create(&block) ⇒ Object



21
22
23
24
# File 'lib/instalatron.rb', line 21

def self.create(&block)
  i = self.new
  i.instance_eval &block
end