class Qiita::Elasticsearch::Nodes::QueryNode
Public Class Methods
new(tokens)
click to toggle source
@param [Array<Qiita::Elasticsearch::Tokens>] tokens
# File lib/qiita/elasticsearch/nodes/query_node.rb, line 9 def initialize(tokens) @tokens = tokens end
Public Instance Methods
to_hash()
click to toggle source
# File lib/qiita/elasticsearch/nodes/query_node.rb, line 13 def to_hash case @tokens.length when 0 {} when 1 MatchNode.new(@tokens.first).to_hash else MultiMustNode.new(@tokens).to_hash end end