Class: Gm::Notepad::Parameters::TableLookup
- Inherits:
-
Object
- Object
- Gm::Notepad::Parameters::TableLookup
- Defined in:
- lib/gm/notepad/parameters/table_lookup.rb
Overview
Responsible for teasing apart the table logic
Instance Attribute Summary collapse
-
#cell ⇒ Object
readonly
Returns the value of attribute cell.
-
#grep ⇒ Object
readonly
Returns the value of attribute grep.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
-
#initialize(text:, roll_dice: false) ⇒ TableLookup
constructor
A new instance of TableLookup.
- #parameters ⇒ Object
Constructor Details
#initialize(text:, roll_dice: false) ⇒ TableLookup
Returns a new instance of TableLookup.
7 8 9 10 11 12 13 |
# File 'lib/gm/notepad/parameters/table_lookup.rb', line 7 def initialize(text:, roll_dice: false) @text = text.strip @role_dice = false @parameters = {} extract_parameters! roll_them_bones! if roll_dice end |
Instance Attribute Details
#cell ⇒ Object
Returns the value of attribute cell.
15 16 17 |
# File 'lib/gm/notepad/parameters/table_lookup.rb', line 15 def cell @cell end |
#grep ⇒ Object
Returns the value of attribute grep.
15 16 17 |
# File 'lib/gm/notepad/parameters/table_lookup.rb', line 15 def grep @grep end |
#index ⇒ Object
Returns the value of attribute index.
15 16 17 |
# File 'lib/gm/notepad/parameters/table_lookup.rb', line 15 def index @index end |
#table_name ⇒ Object
Returns the value of attribute table_name.
15 16 17 |
# File 'lib/gm/notepad/parameters/table_lookup.rb', line 15 def table_name @table_name end |
Instance Method Details
#parameters ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/gm/notepad/parameters/table_lookup.rb', line 17 def parameters parameters = { table_name: table_name } parameters[:grep] = grep if grep parameters[:index] = index if index parameters[:cell] = cell if cell parameters end |