lib/axiom/function.rb in axiom-0.1.0 vs lib/axiom/function.rb in axiom-0.1.1
- old
+ new
@@ -4,12 +4,12 @@
# Abstract base class for logical functions
class Function
include AbstractType, Adamantium, Visitable
- abstract_singleton_method :call
- abstract_method :rename, :type
+ abstract_singleton_method :call, :type
+ abstract_method :rename
# Rename the attribute(s) inside the function
#
# @param [Function] operand
#
@@ -38,9 +38,21 @@
# @return [Object]
#
# @api private
def self.extract_value(operand, tuple)
operand.respond_to?(:call) ? operand.call(tuple) : operand
+ end
+
+ # Return the function type
+ #
+ # @example
+ # type = function.type # => Axiom::Types::Object
+ #
+ # @return [Class<Types::Object>]
+ #
+ # @api public
+ def type
+ self.class.type
end
end # class Function
end # module Axiom