Class: Configural::Data
- Inherits:
-
Object
- Object
- Configural::Data
- Defined in:
- lib/configural/data.rb
Direct Known Subclasses
Defined Under Namespace
Classes: DataFile
Instance Attribute Summary collapse
-
#owner ⇒ Object
Returns the value of attribute owner.
Instance Method Summary collapse
- #[](name) ⇒ Object
- #[]=(name, value) ⇒ Object
-
#initialize(owner) ⇒ Data
constructor
A new instance of Data.
- #path ⇒ Object
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
#owner ⇒ Object
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 |
#path ⇒ Object
41 42 43 |
# File 'lib/configural/data.rb', line 41 def path @owner.data_path end |