Class: BB::Converter::Order

Inherits:
Object
  • Object
show all
Defined in:
lib/b_b/converter/order.rb

Constant Summary collapse

TEMPLATE =
"%s %s".freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(column, options = {}) ⇒ Order



8
9
10
11
# File 'lib/b_b/converter/order.rb', line 8

def initialize(column, options = {})
  @column   = column
  @sort_key = format_sort_key(options[:sort_key])
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



6
7
8
# File 'lib/b_b/converter/order.rb', line 6

def column
  @column
end

#sort_keyObject (readonly)

Returns the value of attribute sort_key.



6
7
8
# File 'lib/b_b/converter/order.rb', line 6

def sort_key
  @sort_key
end

Class Method Details

.convert(column, options = {}) ⇒ Object



24
25
26
# File 'lib/b_b/converter/order.rb', line 24

def convert(column, options = {})
  new(column, options).convert
end

Instance Method Details

#convertObject



13
14
15
# File 'lib/b_b/converter/order.rb', line 13

def convert
  format(TEMPLATE, column, sort_key)
end