Class: Zinx::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/zinx.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sphinx_hash) ⇒ Result

Returns a new instance of Result.



235
236
237
238
239
240
241
# File 'lib/zinx.rb', line 235

def initialize(sphinx_hash)
	@matches = []
	@sphinx_hash = sphinx_hash
	@sphinx_hash["matches"].each do |match|
		@matches << Match.new(match)
	end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method) ⇒ Object



243
244
245
# File 'lib/zinx.rb', line 243

def method_missing(method)
	@sphinx_hash["#{method}"]
end

Instance Attribute Details

#matchesObject (readonly)

Returns the value of attribute matches.



233
234
235
# File 'lib/zinx.rb', line 233

def matches
  @matches
end