Class: Configuration::Matcher

Inherits:
Object
  • Object
show all
Defined in:
lib/httpimagestore/configuration/handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(names, debug_type = '', debug_value = '', &matcher) ⇒ Matcher

Returns a new instance of Matcher.



292
293
294
295
296
297
298
299
300
301
302
# File 'lib/httpimagestore/configuration/handler.rb', line 292

def initialize(names, debug_type = '', debug_value = '', &matcher)
	@names = names
	@matcher = matcher
	@debug_type = debug_type
	@debug_value = case debug_value
	when Regexp
		"/#{debug_value.source}/"
	else
		debug_value.inspect
	end
end

Instance Attribute Details

#matcherObject (readonly)

Returns the value of attribute matcher.



305
306
307
# File 'lib/httpimagestore/configuration/handler.rb', line 305

def matcher
  @matcher
end

#namesObject (readonly)

Returns the value of attribute names.



304
305
306
# File 'lib/httpimagestore/configuration/handler.rb', line 304

def names
  @names
end

Instance Method Details

#to_sObject



307
308
309
310
311
312
313
# File 'lib/httpimagestore/configuration/handler.rb', line 307

def to_s
	if @names.empty?
		"#{@debug_type}(#{@debug_value})"
	else
		"#{@debug_type}(#{@names.join(',')} => #{@debug_value})"
	end
end