Class: CloudSesame::Query::Node::QueryOptionsField
- Inherits:
-
Object
- Object
- CloudSesame::Query::Node::QueryOptionsField
- Defined in:
- lib/cloud_sesame/query/node/query_options_field.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(field, weight = nil) ⇒ QueryOptionsField
constructor
A new instance of QueryOptionsField.
Constructor Details
#initialize(field, weight = nil) ⇒ QueryOptionsField
Returns a new instance of QueryOptionsField.
8 9 10 11 |
# File 'lib/cloud_sesame/query/node/query_options_field.rb', line 8 def initialize(field, weight = nil) @field = field @weight = weight end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
6 7 8 |
# File 'lib/cloud_sesame/query/node/query_options_field.rb', line 6 def field @field end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
6 7 8 |
# File 'lib/cloud_sesame/query/node/query_options_field.rb', line 6 def weight @weight end |
Instance Method Details
#compile ⇒ Object
13 14 15 16 17 |
# File 'lib/cloud_sesame/query/node/query_options_field.rb', line 13 def compile compiled = field.to_s compiled << '^' << weight.to_s if weight compiled end |