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.
35 36 37 38 |
# File 'lib/super/sort.rb', line 35 def initialize(a:, d:) @a = a @d = d.to_s end |
Instance Attribute Details
#a ⇒ Object
attribute
32 33 34 |
# File 'lib/super/sort.rb', line 32 def a @a end |
#d ⇒ Object
direction
33 34 35 |
# File 'lib/super/sort.rb', line 33 def d @d end |
Instance Method Details
#id ⇒ Object
This is for fields_for
to work
46 47 48 |
# File 'lib/super/sort.rb', line 46 def id @index end |
#persisted? ⇒ Boolean
50 51 52 |
# File 'lib/super/sort.rb', line 50 def persisted? false end |
#with_index(index) ⇒ Object
40 41 42 43 |
# File 'lib/super/sort.rb', line 40 def with_index(index) @index = index self end |