Sha256: 008c5af966f786b04f29c2f389c8c03b220747b5104c181f2636d2243a787ab3
Contents?: true
Size: 609 Bytes
Versions: 21
Compression:
Stored size: 609 Bytes
Contents
module ROXML class HashDefinition # :nodoc: attr_reader :key, :value attr_accessor :wrapper def initialize(opts) opts.assert_valid_keys(:key, :value) @key = Definition.new(nil, to_definition_options(opts, :key)) @value = Definition.new(nil, to_definition_options(opts, :value)) end private def to_definition_options(opts, what) case opts[what] when Hash opts[what] when String, Symbol {:from => opts[what]} else raise ArgumentError, "unrecognized hash parameter: #{what} => #{opts[what]}" end end end end
Version data entries
21 entries across 21 versions & 5 rubygems