Class: Ecogem::Util::Config::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/ecogem/util/config/entry.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, key) ⇒ Entry

Returns a new instance of Entry.



7
8
9
10
# File 'lib/ecogem/util/config/entry.rb', line 7

def initialize(config, key)
  @config = config
  @key = key
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



5
6
7
# File 'lib/ecogem/util/config/entry.rb', line 5

def key
  @key
end

Class Method Details

.create(config, key, options = {}) ⇒ Object



12
13
14
15
# File 'lib/ecogem/util/config/entry.rb', line 12

def self.create(config, key, options = {})
  klass = options[:class] || config.find_entry_class(key)
  klass.new(config, key)
end