Module: Alf::Algebra::Unary

Included in:
Allbut, Autonum, Clip, Coerce, Compact, Defaults, Extend, Frame, Group, Hierarchize, Page, Project, Quota, Rank, Rename, Restrict, Sort, Summarize, Ungroup, Unwrap, Wrap
Defined in:
lib/alf/algebra/support/unary.rb

Overview

Specialization of Operator for operators that work on a unary input

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(mod) ⇒ Object

module ClassMethods


18
19
20
21
# File 'lib/alf/algebra/support/unary.rb', line 18

def self.included(mod)
  super
  mod.extend(ClassMethods)
end

Instance Method Details

#operandObject

Simply returns the first operand


24
25
26
# File 'lib/alf/algebra/support/unary.rb', line 24

def operand
  operands.first
end

#with_operand(operand) ⇒ Object


28
29
30
# File 'lib/alf/algebra/support/unary.rb', line 28

def with_operand(operand)
  with_operands(operand)
end