Class: Gonzui::QueryItem

Inherits:
Struct
  • Object
show all
Defined in:
lib/gonzui/searchquery.rb,
lib/gonzui/searchquery.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#phrase_pObject

Returns the value of attribute phrase_p

Returns:

  • (Object)

    the current value of phrase_p



13
14
15
# File 'lib/gonzui/searchquery.rb', line 13

def phrase_p
  @phrase_p
end

#propertyObject

Returns the value of attribute property

Returns:

  • (Object)

    the current value of property



13
14
15
# File 'lib/gonzui/searchquery.rb', line 13

def property
  @property
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



13
14
15
# File 'lib/gonzui/searchquery.rb', line 13

def value
  @value
end

Instance Method Details

#phrase?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/gonzui/searchquery.rb', line 26

def phrase?
  self.phrase_p == true
end

#to_sObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/gonzui/searchquery.rb', line 15

def to_s
  string = ""
  string << self.property.to_s << ":" if self.property
  if phrase?
    string << sprintf('"%s"', self.value.join(" "))
  else
    string << self.value
  end
  return string
end