Class: ChinoRuby::SortOption

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

Direct Known Subclasses

ChinoSortOption

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.



1321
1322
1323
1324
1325
1326
# File 'lib/chino_ruby/classes.rb', line 1321

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.



1319
1320
1321
# File 'lib/chino_ruby/classes.rb', line 1319

def field
  @field
end

#orderObject

Returns the value of attribute order.



1319
1320
1321
# File 'lib/chino_ruby/classes.rb', line 1319

def order
  @order
end

Instance Method Details

#to_jsonObject



1328
1329
1330
# File 'lib/chino_ruby/classes.rb', line 1328

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