Class: XTF::Search::Element::Phrase

Inherits:
Clause show all
Defined in:
lib/xtf/search/element/phrase.rb

Direct Known Subclasses

Exact

Constant Summary

Constants inherited from Clause

Clause::VALID_TAG_NAMES

Constants inherited from Base

Base::BASE_ATTRIBUTE_KEYS

Instance Attribute Summary collapse

Attributes inherited from Clause

#content, #section_type, #term

Attributes inherited from Base

#tag_name

Instance Method Summary collapse

Methods inherited from Clause

create, #to_xml, #to_xml_node

Methods inherited from Base

attribute_keys, #attributes

Constructor Details

#initialize(*args) ⇒ Phrase

Returns a new instance of Phrase.



5
6
7
8
9
10
11
# File 'lib/xtf/search/element/phrase.rb', line 5

def initialize(*args)
  @tag_name = "phrase"
  params = args[0] || {}
  _phrase = params.delete(:phrase)
  super(params)
  self.phrase = _phrase if _phrase
end

Instance Attribute Details

#phraseObject

Takes a String and breaks it up into Terms:



3
4
5
# File 'lib/xtf/search/element/phrase.rb', line 3

def phrase
  @phrase
end