config

config()
Instance Public methods

Reads and writes attributes from a configuration OrderedHash.

1
2
3
4
5
6
7
8
9
10
11
12
13
require 'active_support/configurable'
 
class User
  include ActiveSupport::Configurable
end
 
user = User.new
 
user.config.allowed_access = true
user.config.level = 1
 
user.config.allowed_access # => true
user.config.level          # => 1
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.