Class: Super::Sort::FormObject::Expression

Inherits:
Object
  • Object
show all
Defined in:
lib/super/sort.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#aObject

attribute



32
33
34
# File 'lib/super/sort.rb', line 32

def a
  @a
end

#dObject

direction



33
34
35
# File 'lib/super/sort.rb', line 33

def d
  @d
end

Instance Method Details

#idObject

This is for fields_for to work



46
47
48
# File 'lib/super/sort.rb', line 46

def id
  @index
end

#persisted?Boolean

Returns:

  • (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