Class: Linkage::Configuration::DSL::DatasetWrapper
- Inherits:
-
Object
- Object
- Linkage::Configuration::DSL::DatasetWrapper
- Defined in:
- lib/linkage/configuration.rb
Instance Attribute Summary collapse
-
#dataset ⇒ Object
readonly
Returns the value of attribute dataset.
Instance Method Summary collapse
- #[](field_name) ⇒ Object
-
#initialize(dsl, side, dataset) ⇒ DatasetWrapper
constructor
A new instance of DatasetWrapper.
Constructor Details
#initialize(dsl, side, dataset) ⇒ DatasetWrapper
Returns a new instance of DatasetWrapper.
184 185 186 187 188 |
# File 'lib/linkage/configuration.rb', line 184 def initialize(dsl, side, dataset) @dsl = dsl @dataset = dataset @side = side end |
Instance Attribute Details
#dataset ⇒ Object (readonly)
Returns the value of attribute dataset.
182 183 184 |
# File 'lib/linkage/configuration.rb', line 182 def dataset @dataset end |
Instance Method Details
#[](field_name) ⇒ Object
190 191 192 193 194 195 196 |
# File 'lib/linkage/configuration.rb', line 190 def [](field_name) if @dataset.field_set.has_key?(field_name) FieldWrapper.new(@dsl, @side, @dataset, field_name) else raise ArgumentError, "The '#{field_name}' field doesn't exist for the #{@side} dataset!" end end |