Class: Rasti::DB::ComputedAttribute

Inherits:
Object
  • Object
show all
Defined in:
lib/rasti/db/computed_attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#identifierObject (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