Class: Operation

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

Overview

The Operation class is the Hitsuji representation of an equation, and its properties include a name, a value and a block. The value is an Linker with read-write properties, and the values in this Linker are parsed into the block for execution. This block is not presented as block however, but as a string, only executed upon read of dependent values. Once the Operation is bound, a seperate method must be used to read them. Linkers are the main interface between Items and Operations. Examples of its use can be seen in the documentation for the Hitsuji.operation method.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, input, block) ⇒ Operation

Returns a new instance of Operation.



38
39
40
41
42
# File 'lib/subsystem.rb', line 38

def initialize(name, input, block)
  @name = name
  @input = input
  @block = block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



44
45
46
# File 'lib/subsystem.rb', line 44

def block
  @block
end

#inputObject

Returns the value of attribute input.



45
46
47
# File 'lib/subsystem.rb', line 45

def input
  @input
end

#nameObject

Returns the value of attribute name.



45
46
47
# File 'lib/subsystem.rb', line 45

def name
  @name
end