Sha256: 123d4d63e7fa8a82aa25025a6fccc1db26e6fb1b50f0da17ce2a41077e968ff6
Contents?: true
Size: 649 Bytes
Versions: 8
Compression:
Stored size: 649 Bytes
Contents
require_relative 'prop' module Immutabler module DSL class PropsBuilder def initialize(props, &block) @props = props instance_eval(&block) end def prop(name, type, options={}) prop_options = {} prop_options[:is_ref] = options[:is_ref] if options.key?(:is_ref) prop_options[:ref_type] = options[:ref_type] if options.key?(:ref_type) prop_options[:name_prefix] = options[:name_prefix] if options.key?(:name_prefix) prop_options[:is_id] = options[:is_id] if options.key?(:is_id) @props << Prop.new(name.to_s, type.to_s, prop_options) end end end end
Version data entries
8 entries across 8 versions & 1 rubygems