lib/pudl/property_types.rb
# Define a DSL property that accepts a single value
# or a block. If no value specified, pass the block
Define a DSL property that accepts a single value
or a block. If no value specified, pass the block
Define a DSL property that accepts a single value or a block . If no value specified pass the block
def property_single name, &block
        send :define_method, name do |v=nil, &b|
          if !v.nil? && !b.nil?
            raise ArgumentError, "Cannot specify a value and a block in a single property"
          end
          v = b if v.nil?
          instance_exec v, &block
        end
      end
def property_single name , & block send :define_method , name do | v = nil , & b | if ! v . nil? && ! b . nil? raise ArgumentError , "Cannot specify a value and a block in a single property" end v = b if v . nil? instance_exec v , & block end end
Define a DSL property that accepts a single value
or a block.
Define a DSL property that accepts a single value or a block .
name
<not_specific>
block
<not_specific>