Class: TinyUtil::ConfigUtilItem

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(item = {}) ⇒ ConfigUtilItem

Returns a new instance of ConfigUtilItem.



119
120
121
# File 'lib/tiny_util/config.rb', line 119

def initialize(item={})
  @item = item || {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



127
128
129
# File 'lib/tiny_util/config.rb', line 127

def method_missing(method_name, *args, &block)
  @item[method_name.to_sym]
end

Instance Attribute Details

#itemObject (readonly)

Returns the value of attribute item.



117
118
119
# File 'lib/tiny_util/config.rb', line 117

def item
  @item
end

Instance Method Details

#[](key) ⇒ Object



123
124
125
# File 'lib/tiny_util/config.rb', line 123

def [] key
  @item[key]
end