Class: SPF::Query::Modifier

Inherits:
Object
  • Object
show all
Defined in:
lib/spf/query/modifier.rb

Direct Known Subclasses

UnknownModifier

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value = nil) ⇒ Modifier

Returns a new instance of Modifier.



9
10
11
# File 'lib/spf/query/modifier.rb', line 9

def initialize(name,value=nil)
  @name, @value = name, value
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/spf/query/modifier.rb', line 5

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'lib/spf/query/modifier.rb', line 7

def value
  @value
end

Instance Method Details

#to_sObject



13
14
15
16
17
# File 'lib/spf/query/modifier.rb', line 13

def to_s
  if @value then "#{@name}=#{@value}"
  else           "#{@name}"
  end
end