Class: Flock::SelectOperations::Selecticon

Inherits:
Object
  • Object
show all
Defined in:
lib/flock/operations/select_operations.rb

Instance Method Summary collapse

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_edgesObject



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_idsObject



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