module Easy_Set::Singleton_Methods

Public Instance Methods

[](key) click to toggle source
# File lib/easy_set.rb, line 7
def [](key)
  @store[key]
end
[]=(key,value) click to toggle source
# File lib/easy_set.rb, line 11
def []=(key,value)
  @store[key] = value
end
display() click to toggle source
# File lib/easy_set.rb, line 15
def display
  @store.inspect
end
generate_rand_string(length=nil) click to toggle source
# File lib/easy_set.rb, line 19
def generate_rand_string(length=nil)
  o = [('a'..'z'), ('A'..'Z')].map { |i| i.to_a }.flatten
  return (0...(length||32)).map { o[rand(o.length)] }.join
end
load_config_from(path) click to toggle source
# File lib/easy_set.rb, line 24
def load_config_from path
  @store[:config] = YAML.load_file(path)
end
to_s() click to toggle source
# File lib/easy_set.rb, line 28
def to_s
  @store.each do |key,value|
    puts "#{key}: #{value.to_s}"
  end
  puts ""
end

Private Instance Methods

set(key, value) click to toggle source
# File lib/easy_set.rb, line 36
def set key, value
  @store[key] = value
end