Module: Suhyo

Defined in:
lib/suhyo/config.rb,
lib/suhyo/view_matchers.rb,
lib/suhyo/controller_matchers.rb

Defined Under Namespace

Modules: ControllerMatchers, ViewMatchers

Class Method Summary collapse

Class Method Details

.config {|@config| ... } ⇒ Object

Get/set Suhyo’s config values. This method can be used in several ways:

  1. To get config values:

puts Suhyo.config.access_denied_url
  1. To set config values:

Suhyo.config.access_denied_url = 'http://test.host/login'
  1. To set config values in block form:

Suhyo.config do |config|
  config.access_denied_url = 'http://test.host/login'
end

Yields:



14
15
16
17
18
19
20
21
# File 'lib/suhyo/config.rb', line 14

def self.config
	@config ||= OpenStruct.new
	# Set defaults here
	@config.access_denied_url ||= 'http://test.host/login'
	# End of defaults
	yield @config if block_given?
	@config
end