Class: Ruleby::Core::Atom

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

Direct Known Subclasses

HeadAtom, PropertyAtom, ReferenceAtom

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag, method, deftemplate, &block) ⇒ Atom

Returns a new instance of Atom.



19
20
21
22
23
24
# File 'lib/core/atoms.rb', line 19

def initialize(tag, method, deftemplate, &block)
  @tag = tag
  @method = method
  @deftemplate = deftemplate
  @proc = Proc.new(&block) if block_given?
end

Instance Attribute Details

#deftemplateObject (readonly)

Returns the value of attribute deftemplate.



17
18
19
# File 'lib/core/atoms.rb', line 17

def deftemplate
  @deftemplate
end

#methodObject (readonly)

Returns the value of attribute method.



17
18
19
# File 'lib/core/atoms.rb', line 17

def method
  @method
end

#procObject (readonly)

Returns the value of attribute proc.



17
18
19
# File 'lib/core/atoms.rb', line 17

def proc
  @proc
end

#tagObject (readonly)

Returns the value of attribute tag.



17
18
19
# File 'lib/core/atoms.rb', line 17

def tag
  @tag
end

Instance Method Details

#to_sObject



26
27
28
# File 'lib/core/atoms.rb', line 26

def to_s
  return "#{self.class},#{@tag},#{@method},#{@deftemplate}"
end