Class: Verneuil::Block
- Inherits:
-
Object
- Object
- Verneuil::Block
- Defined in:
- lib/verneuil/block.rb
Overview
Abstracts the notion of a block.
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
At what address does the block code start?.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
- #call(*args) ⇒ Object
-
#initialize(address, process, scope) ⇒ Block
constructor
A new instance of Block.
- #inspect ⇒ Object
Constructor Details
#initialize(address, process, scope) ⇒ Block
Returns a new instance of Block.
9 10 11 12 13 |
# File 'lib/verneuil/block.rb', line 9 def initialize(address, process, scope) @address = address @process = process @scope = scope end |
Instance Attribute Details
#address ⇒ Object (readonly)
At what address does the block code start?
6 7 8 |
# File 'lib/verneuil/block.rb', line 6 def address @address end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
7 8 9 |
# File 'lib/verneuil/block.rb', line 7 def scope @scope end |
Instance Method Details
#call(*args) ⇒ Object
15 16 17 18 |
# File 'lib/verneuil/block.rb', line 15 def call(*args) @process.enter_block(args, @address, @scope) throw :verneuil_code end |
#inspect ⇒ Object
20 21 22 |
# File 'lib/verneuil/block.rb', line 20 def inspect "block@#{@address.ip}(#{@scope.inspect})" end |