Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (21 sloc) 532 Bytes
require 'singleton'
module Wikipedia
class Configuration
include Singleton
def self.directives(*directives)
directives.each do |directive|
define_method directive do |*args|
if args.empty?
return instance_variable_get("@#{directive}")
else
instance_variable_set("@#{directive}", args.first)
end
end
end
end
def self.[](directive)
instance.send(directive)
end
directives :protocol, :domain, :path
end
end
Jump to Line
Something went wrong with that request. Please try again.