Module: Stupidedi::Versions::FunctionalGroups::FiftyTen::ElementTypes::Operators::Unary

Included in:
DateVal::Proper, FixnumVal::NonEmpty, FloatVal::NonEmpty, IdentifierVal::Empty, IdentifierVal::NonEmpty, StringVal::Empty, StringVal::NonEmpty
Defined in:
lib/stupidedi/versions/functional_groups/005010/element_types/operators.rb

Instance Method Summary collapse

Instance Method Details

#unary_operators(*ops)



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/stupidedi/versions/functional_groups/005010/element_types/operators.rb', line 12

def unary_operators(*ops)
  file, line, = Stupidedi.caller

  ops.each do |op|
    class_eval("def \#{op}(&block)\ncopy(:value => value.\#{op}(&block))\nend\n", file, line.to_i - 1)
  end
end