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.



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

#aObject

attribute



30
31
32
# File 'lib/super/sort.rb', line 30

def a
  @a
end

#dObject

direction



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

def d
  @d
end

Instance Method Details

#idObject

This is for fields_for to work



44
45
46
# File 'lib/super/sort.rb', line 44

def id
  @index
end

#persisted?Boolean

Returns:

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