Class: Super::Sort::FormObject::Expression
- Inherits:
-
Object
- Object
- Super::Sort::FormObject::Expression
- Defined in:
- lib/super/sort.rb
Instance Attribute Summary collapse
-
#a ⇒ Object
attribute.
-
#d ⇒ Object
direction.
Instance Method Summary collapse
-
#id ⇒ Object
This is for
fields_for
to work. -
#initialize(a:, d:) ⇒ Expression
constructor
A new instance of Expression.
- #persisted? ⇒ Boolean
- #with_index(index) ⇒ Object
Constructor Details
#initialize(a:, d:) ⇒ Expression
Returns a new instance of Expression.
33 34 35 36 |
# File 'lib/super/sort.rb', line 33 def initialize(a:, d:) @a = a @d = d.to_s end |
Instance Attribute Details
#a ⇒ Object
attribute
30 31 32 |
# File 'lib/super/sort.rb', line 30 def a @a end |
#d ⇒ Object
direction
31 32 33 |
# File 'lib/super/sort.rb', line 31 def d @d end |
Instance Method Details
#id ⇒ Object
This is for fields_for
to work
44 45 46 |
# File 'lib/super/sort.rb', line 44 def id @index end |
#persisted? ⇒ Boolean
48 49 50 |
# File 'lib/super/sort.rb', line 48 def persisted? false end |
#with_index(index) ⇒ Object
38 39 40 41 |
# File 'lib/super/sort.rb', line 38 def with_index(index) @index = index self end |