Class: Pivotable::Expression::Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/pivotable/expression/abstract.rb

Direct Known Subclasses

Calculation, Generic

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, name, options = {}) ⇒ Abstract

Returns a new instance of Abstract.

Raises:

  • (ArgumentError)


4
5
6
7
8
9
10
# File 'lib/pivotable/expression/abstract.rb', line 4

def initialize(model, name, options = {})
  @name  = name.to_s
  @model = model
  @via   = process_via options[:via]

  raise ArgumentError, "Could not find DB attribute for '#{@name}', please specify a :via option" if via.blank?
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



2
3
4
# File 'lib/pivotable/expression/abstract.rb', line 2

def model
  @model
end

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/pivotable/expression/abstract.rb', line 2

def name
  @name
end

#viaObject (readonly)

Returns the value of attribute via.



2
3
4
# File 'lib/pivotable/expression/abstract.rb', line 2

def via
  @via
end

Instance Method Details

#to_groupObject



16
17
18
# File 'lib/pivotable/expression/abstract.rb', line 16

def to_group
  not_implemented
end

#to_selectObject



12
13
14
# File 'lib/pivotable/expression/abstract.rb', line 12

def to_select
  not_implemented
end