Class: Pivotable::Expression::Abstract
- Inherits:
-
Object
- Object
- Pivotable::Expression::Abstract
- Defined in:
- lib/pivotable/expression/abstract.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#via ⇒ Object
readonly
Returns the value of attribute via.
Instance Method Summary collapse
-
#initialize(model, name, options = {}) ⇒ Abstract
constructor
A new instance of Abstract.
- #to_group ⇒ Object
- #to_select ⇒ Object
Constructor Details
#initialize(model, name, options = {}) ⇒ Abstract
Returns a new instance of Abstract.
4 5 6 7 8 9 10 |
# File 'lib/pivotable/expression/abstract.rb', line 4 def initialize(model, name, = {}) @name = name.to_s @model = model @via = process_via [:via] raise ArgumentError, "Could not find DB attribute for '#{@name}', please specify a :via option" if via.blank? end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
2 3 4 |
# File 'lib/pivotable/expression/abstract.rb', line 2 def model @model end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/pivotable/expression/abstract.rb', line 2 def name @name end |
#via ⇒ Object (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_group ⇒ Object
16 17 18 |
# File 'lib/pivotable/expression/abstract.rb', line 16 def to_group not_implemented end |
#to_select ⇒ Object
12 13 14 |
# File 'lib/pivotable/expression/abstract.rb', line 12 def to_select not_implemented end |