Class: SPF::Query::Modifier
- Inherits:
-
Object
- Object
- SPF::Query::Modifier
- Defined in:
- lib/spf/query/modifier.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, value = nil) ⇒ Modifier
constructor
A new instance of Modifier.
- #to_s ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/spf/query/modifier.rb', line 5 def name @name end |
#value ⇒ Object (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_s ⇒ Object
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 |