class SiteHealth::UrlMap
Hash-like data structure that holds URI as keys and can be accessed using an URI instance or the String representation
Public Class Methods
new() { || ... }
click to toggle source
# File lib/site_health/url_map.rb, line 9 def initialize @data = if block_given? Hash.new { |hash, key| hash[key] = yield } else {} end end
Public Instance Methods
[](key)
click to toggle source
@return [Object] value for key
# File lib/site_health/url_map.rb, line 26 def [](key) @data[key.to_s] end
[]=(key, value)
click to toggle source
Sets value for key @return [Object] value for key
# File lib/site_health/url_map.rb, line 32 def []=(key, value) @data[key.to_s] = value end
each() { |key, value| ... }
click to toggle source
@yieldparam [Object] value for key @return [Enumerator] data
# File lib/site_health/url_map.rb, line 19 def each @data.each do |key, value| yield(key, value) if block_given? end end
to_h()
click to toggle source
@return [Hash] hash representation of data
# File lib/site_health/url_map.rb, line 37 def to_h @data end