class Simple::Hash
Constants
- VERSION
Public Instance Methods
method_missing(method_name, *args, &block)
click to toggle source
Calls superclass method
# File lib/simple/hash.rb, line 10 def method_missing(method_name, *args, &block) if keys.map(&:to_s).include?(method_name.to_s) && args.empty? && block.nil? fetch(method_name) else super end end
methods()
click to toggle source
Calls superclass method
# File lib/simple/hash.rb, line 22 def methods super + keys.map(&:to_sym) end
respond_to_missing?(method_name, include_private = false)
click to toggle source
Calls superclass method
# File lib/simple/hash.rb, line 18 def respond_to_missing?(method_name, include_private = false) keys.map(&:to_s).include?(method_name.to_s) || super end
Protected Instance Methods
convert_value(value, options = {})
click to toggle source
# File lib/simple/hash.rb, line 28 def convert_value(value, options = {}) if value.is_a?(Hash) Simple::Hash.new(value).freeze elsif value.is_a?(Array) value.map { |val| convert_value(val, options) } else value end end