Class: SortOption

Inherits:
CheckValues show all
Defined in:
lib/chino_ruby.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from CheckValues

#check_boolean, #check_int, #check_json, #check_string

Constructor Details

#initialize(field, order) ⇒ SortOption

Returns a new instance of SortOption.



1377
1378
1379
1380
1381
1382
# File 'lib/chino_ruby.rb', line 1377

def initialize(field, order)
    check_string(field)
    check_string(order)
    self.field = field
    self.order = order
end

Instance Attribute Details

#fieldObject

Returns the value of attribute field.



1375
1376
1377
# File 'lib/chino_ruby.rb', line 1375

def field
  @field
end

#orderObject

Returns the value of attribute order.



1375
1376
1377
# File 'lib/chino_ruby.rb', line 1375

def order
  @order
end

Instance Method Details

#to_jsonObject



1384
1385
1386
# File 'lib/chino_ruby.rb', line 1384

def to_json
    {"field": field, "order": order}.to_json
end