Class: Messiah::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(key, *val, &block) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/messiah/config.rb', line 8

def method_missing(key, *val, &block)
  @values ||= {}
  if val.first || block
    @values[key.to_s.gsub(/=/, '')] = val.first || block
  else
    @values[key.to_s]
  end
end

Instance Attribute Details

#valuesObject

Returns the value of attribute values.



2
3
4
# File 'lib/messiah/config.rb', line 2

def values
  @values
end

Instance Method Details

#respond_to?(key) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/messiah/config.rb', line 4

def respond_to?(key)
  true
end