Class: Flock::SelectOperations::Selecticon
- Inherits:
-
Object
- Object
- Flock::SelectOperations::Selecticon
- Defined in:
- lib/flock/operations/select_operations.rb
Instance Method Summary collapse
-
#initialize(term) ⇒ Selecticon
constructor
A new instance of Selecticon.
- #paginate(count, cursor = Flock::CursorStart) ⇒ Object
- #to_thrift_edges ⇒ Object
- #to_thrift_ids ⇒ Object
Constructor Details
#initialize(term) ⇒ Selecticon
Returns a new instance of Selecticon.
64 65 66 67 |
# File 'lib/flock/operations/select_operations.rb', line 64 def initialize(term) @term = term @count, @cursor = 20, Flock::CursorStart end |
Instance Method Details
#paginate(count, cursor = Flock::CursorStart) ⇒ Object
69 70 71 |
# File 'lib/flock/operations/select_operations.rb', line 69 def paginate(count, cursor = Flock::CursorStart) @count, @cursor = count, cursor end |
#to_thrift_edges ⇒ Object
86 87 88 89 90 91 92 93 94 |
# File 'lib/flock/operations/select_operations.rb', line 86 def to_thrift_edges query = Edges::EdgeQuery.new query.term = @term.to_thrift page = Flock::Page.new page.cursor = @cursor page.count = @count query.page = page query end |
#to_thrift_ids ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/flock/operations/select_operations.rb', line 73 def to_thrift_ids query = Edges::SelectQuery.new operation = Edges::SelectOperation.new operation.operation_type = Edges::SelectOperationType::SimpleQuery operation.term = @term.to_thrift query.operations = [operation] page = Flock::Page.new page.cursor = @cursor page.count = @count query.page = page query end |