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.



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

#matchesObject (readonly)

Returns the value of attribute matches.



229
230
231
# File 'lib/zinx.rb', line 229

def matches
  @matches
end