Class: Tablescript::TableEntry
- Inherits:
-
Object
- Object
- Tablescript::TableEntry
- Defined in:
- lib/tablescript/table_entry.rb
Overview
TableEntry
Instance Attribute Summary collapse
-
#blk ⇒ Object
readonly
Returns the value of attribute blk.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#roll ⇒ Object
readonly
Returns the value of attribute roll.
Instance Method Summary collapse
- #evaluate(roll, table) ⇒ Object
-
#initialize(id, roll, blk) ⇒ TableEntry
constructor
A new instance of TableEntry.
Constructor Details
#initialize(id, roll, blk) ⇒ TableEntry
Returns a new instance of TableEntry.
25 26 27 28 29 |
# File 'lib/tablescript/table_entry.rb', line 25 def initialize(id, roll, blk) @id = id @roll = roll @blk = blk end |
Instance Attribute Details
#blk ⇒ Object (readonly)
Returns the value of attribute blk.
23 24 25 |
# File 'lib/tablescript/table_entry.rb', line 23 def blk @blk end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
23 24 25 |
# File 'lib/tablescript/table_entry.rb', line 23 def id @id end |
#roll ⇒ Object (readonly)
Returns the value of attribute roll.
23 24 25 |
# File 'lib/tablescript/table_entry.rb', line 23 def roll @roll end |
Instance Method Details
#evaluate(roll, table) ⇒ Object
31 32 33 |
# File 'lib/tablescript/table_entry.rb', line 31 def evaluate(roll, table) table.instance_exec(RollContext.new(roll, table, self), &@blk) end |