class Bake::Type::Hash
Public Class Methods
Source
# File vendor/bundle/ruby/3.4.0/gems/bake-0.23.1/lib/bake/type/hash.rb, line 13 def initialize(key_type, value_type) @key_type = key_type @value_type = value_type end
Public Instance Methods
Source
# File vendor/bundle/ruby/3.4.0/gems/bake-0.23.1/lib/bake/type/hash.rb, line 18 def composite? true end
Source
# File vendor/bundle/ruby/3.4.0/gems/bake-0.23.1/lib/bake/type/hash.rb, line 22 def parse(input) hash = {} input.split(",").each do |pair| key, value = pair.split(":", 2) key = @key_type.parse(key) value = @value_type.parse(value) hash[key] = value end return hash end