Class: Zinx::Result
- Inherits:
-
Object
- Object
- Zinx::Result
- Defined in:
- lib/zinx.rb
Instance Attribute Summary collapse
-
#matches ⇒ Object
readonly
Returns the value of attribute matches.
Instance Method Summary collapse
-
#initialize(sphinx_hash) ⇒ Result
constructor
A new instance of Result.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(sphinx_hash) ⇒ Result
Returns a new instance of Result.
231 232 233 234 235 236 237 238 239 |
# File 'lib/zinx.rb', line 231 def initialize(sphinx_hash) @matches = [] @sphinx_hash = sphinx_hash if @sphinx_hash.has_key?("matches") @sphinx_hash["matches"].each do |match| @matches << Match.new(match) end end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
241 242 243 |
# File 'lib/zinx.rb', line 241 def method_missing(method, *args, &block) @sphinx_hash["#{method}"] end |
Instance Attribute Details
#matches ⇒ Object (readonly)
Returns the value of attribute matches.
229 230 231 |
# File 'lib/zinx.rb', line 229 def matches @matches end |