Class: Rasti::DB::ComputedAttribute
- Inherits:
-
Object
- Object
- Rasti::DB::ComputedAttribute
- Defined in:
- lib/rasti/db/computed_attribute.rb
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
Instance Method Summary collapse
- #apply_join(dataset, environment) ⇒ Object
-
#initialize(identifier, &join) ⇒ ComputedAttribute
constructor
A new instance of ComputedAttribute.
Constructor Details
#initialize(identifier, &join) ⇒ ComputedAttribute
Returns a new instance of ComputedAttribute.
7 8 9 10 |
# File 'lib/rasti/db/computed_attribute.rb', line 7 def initialize(identifier, &join) @identifier = identifier @join = join end |
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
5 6 7 |
# File 'lib/rasti/db/computed_attribute.rb', line 5 def identifier @identifier end |
Instance Method Details
#apply_join(dataset, environment) ⇒ Object
12 13 14 |
# File 'lib/rasti/db/computed_attribute.rb', line 12 def apply_join(dataset, environment) join ? join.call(dataset, environment) : dataset end |