BETAmodules.com is in beta — open to partnerships & joint ventures.Build with us

config_accessor

v0.0.3RubyGems· Ruby

== Synopsys Class-level configuration DSL == Installation gem install config_accessor == Examples require 'config_accessor' class Remote configurable! config_accessor :host, :default => "localhost" config_accessor :port, :default => "80", :transform => :to_i config_accessor :proxy_host, :proxy_port end class Local < Remote config_accessor :l_port end Remote.host # => "localhost" Remote.port # => 80 Remote.proxy_host # => nil r = Remote.new r.port = "81" r.port # => 81 Remote.port # => 80 Remote.port = 82 # next expressions are equivalent r.port # => 81 r.config[:port] # => 81 r.config["port"] # => 81 r.config.port # => 81 # It supports inheritance, subclasses cannot change superclasses configurations Local.port # => 80 # You can do it with +configure+ method Local.configure do port 81 end # or Local.configure do |config| config.port 81 end

The verdict
Abandoned. Last published 14 years ago. No recent activity — look for a maintained alternative.
No recent activity — look for a maintained alternative.
Live from the RubyGems registry · derived rules, not AI
How it scores
MaintenanceAbandoned
PopularityNiche
SecurityClean
LicenseUnknown
DepsZero deps
Maintenance
Last published 14 years ago.
Popularity
7 downloads / week
Security
No known advisories for this version (OSV).
License
No license declared.
Dependencies
No runtime dependencies
Recent releases
  • 0.0.314 years ago
  • 0.0.214 years ago
config_accessor — == Synopsys Class-level configuration DSL == Installation gem install config_accessor == Examples require 'config_accessor' class Remote configurable! config_accessor :host, :default => "localhost" config_accessor :port, :default => "80", :transform => :to_i config_accessor :proxy_host, :proxy_port end class Local < Remote config_accessor :l_port end Remote.host # => "localhost" Remote.port # => 80 Remote.proxy_host # => nil r = Remote.new r.port = "81" r.port # => 81 Remote.port # => 80 Remote.port = 82 # next expressions are equivalent r.port # => 81 r.config[:port] # => 81 r.config["port"] # => 81 r.config.port # => 81 # It supports inheritance, subclasses cannot change superclasses configurations Local.port # => 80 # You can do it with +configure+ method Local.configure do port 81 end # or Local.configure do |config| config.port 81 end (Ruby / RubyGems) · Modules