Class: Ruleby::Core::FunctionAtom

Inherits:
Atom
  • Object
show all
Defined in:
lib/core/atoms.rb

Instance Attribute Summary collapse

Attributes inherited from Atom

#proc, #slot, #tag, #template

Instance Method Summary collapse

Constructor Details

#initialize(tag, template, arguments, block) ⇒ FunctionAtom

Returns a new instance of FunctionAtom.



63
64
65
66
67
68
69
# File 'lib/core/atoms.rb', line 63

def initialize(tag, template, arguments, block)
  @tag = tag
  @slot = nil
  @template = template
  @arguments = arguments
  @proc = block
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



61
62
63
# File 'lib/core/atoms.rb', line 61

def arguments
  @arguments
end

Instance Method Details

#shareable?(atom) ⇒ Boolean

Returns:

  • (Boolean)


71
72
73
74
75
76
# File 'lib/core/atoms.rb', line 71

def shareable?(atom)
  FunctionAtom === atom &&
         @template == atom.template &&
         @arguments == atom.arguments &&
         @proc == atom.proc
end

#to_sObject



78
79
80
# File 'lib/core/atoms.rb', line 78

def to_s
  "#{self.class},#{@template},#{@arguments.inspect}"
end