Class: Configural::Data

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

Direct Known Subclasses

Cache

Defined Under Namespace

Classes: DataFile

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner) ⇒ Data

Returns a new instance of Data.



36
37
38
39
# File 'lib/configural/data.rb', line 36

def initialize( owner )
  @owner = owner
  @files = {}
end

Instance Attribute Details

#ownerObject

Returns the value of attribute owner.



34
35
36
# File 'lib/configural/data.rb', line 34

def owner
  @owner
end

Instance Method Details

#[](name) ⇒ Object



45
46
47
# File 'lib/configural/data.rb', line 45

def [](name)
  @files[name.to_s] ||= Data::DataFile.new(self, name.to_s)
end

#[]=(name, value) ⇒ Object



49
50
51
# File 'lib/configural/data.rb', line 49

def []=(name, value)
  @files[name.to_s] = value
end

#pathObject



41
42
43
# File 'lib/configural/data.rb', line 41

def path
  @owner.data_path
end