Class: Exwiw::AfterInsertHook::Context
- Inherits:
-
Object
- Object
- Exwiw::AfterInsertHook::Context
- Defined in:
- lib/exwiw/after_insert_hook.rb
Instance Attribute Summary collapse
-
#cli_options ⇒ Object
readonly
Returns the value of attribute cli_options.
-
#collected ⇒ Object
readonly
Returns the value of attribute collected.
Instance Method Summary collapse
-
#initialize(cli_options) ⇒ Context
constructor
A new instance of Context.
- #insert_sql(template) ⇒ Object (also: #insert_jsonl)
Constructor Details
#initialize(cli_options) ⇒ Context
Returns a new instance of Context.
52 53 54 55 |
# File 'lib/exwiw/after_insert_hook.rb', line 52 def initialize() @cli_options = @collected = [] end |
Instance Attribute Details
#cli_options ⇒ Object (readonly)
Returns the value of attribute cli_options.
50 51 52 |
# File 'lib/exwiw/after_insert_hook.rb', line 50 def @cli_options end |
#collected ⇒ Object (readonly)
Returns the value of attribute collected.
50 51 52 |
# File 'lib/exwiw/after_insert_hook.rb', line 50 def collected @collected end |
Instance Method Details
#insert_sql(template) ⇒ Object Also known as: insert_jsonl
57 58 59 |
# File 'lib/exwiw/after_insert_hook.rb', line 57 def insert_sql(template) @collected << ERB.new(template, trim_mode: '-').result(binding) end |