module Toolhound::Configurable
Attributes
dataserver[W]
attr_accessor :auto_paginate, :per_page
password[W]
attr_accessor :auto_paginate, :per_page
port[W]
attr_accessor :auto_paginate, :per_page
timeout[W]
attr_accessor :auto_paginate, :per_page
username[W]
attr_accessor :auto_paginate, :per_page
Public Class Methods
keys()
click to toggle source
# File lib/toolhound-ruby/configurable.rb, line 10 def keys @keys ||= [ :dataserver, :port, :username, :password, :timeout ] end
Public Instance Methods
configure() { |self| ... }
click to toggle source
Set configuration options using a block
# File lib/toolhound-ruby/configurable.rb, line 22 def configure yield self end
options()
click to toggle source
def api_endpoint
File.join(@api_endpoint, "")
end
# File lib/toolhound-ruby/configurable.rb, line 39 def options Hash[Toolhound::Configurable.keys.map{|key| [key, instance_variable_get(:"@#{key}")]}] end
reset!()
click to toggle source
Reset configuration options to default values
# File lib/toolhound-ruby/configurable.rb, line 27 def reset! Toolhound::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", Toolhound::Default.options[key]) end self end
Also aliased as: setup