Sha256: ab07ca05fba8b5afabd4a03d6f72b8852e45503f5b7540910b9ca29b86b8fad3

Contents?: true

Size: 1011 Bytes

Versions: 1

Compression:

Stored size: 1011 Bytes

Contents

# encoding: utf-8

module Axiom
  class Function
    class Numeric

      # A class representing an absolute function
      class Absolute < Numeric
        include Unary

        # Return the absolute operation
        #
        # @example
        #   Absolute.operation  # => :abs
        #
        # @return [Symbol]
        #
        # @api public
        def self.operation
          :abs
        end

        module Methods
          extend Aliasable

          inheritable_alias(:abs => :absolute)

          # Return an absolute function
          #
          # @example
          #   absolute = attribute.absolute
          #
          # @return [Absolute]
          #
          # @api public
          def absolute
            Absolute.new(self)
          end

        end # module Methods

        Attribute::Numeric.class_eval { include Methods }
        Numeric.class_eval            { include Methods }

      end # class Absolute
    end # class Numeric
  end # class Function
end # module Axiom

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom-0.1.0 lib/axiom/function/numeric/absolute.rb