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)



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

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

  ops.each do |op|
    class_eval(<<-RUBY, file, line.to_i - 1)
      def #{op}(&block)
        copy(:value => value.__send__(:#{op}, &block))
      end
    RUBY
  end
end