Class: RegexpPreview::SingleLine
- Inherits:
-
Object
- Object
- RegexpPreview::SingleLine
- Defined in:
- lib/regexp_preview/single_line.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#plugin ⇒ Object
readonly
Returns the value of attribute plugin.
-
#plugin_config ⇒ Object
readonly
Returns the value of attribute plugin_config.
-
#plugin_name ⇒ Object
readonly
Returns the value of attribute plugin_name.
Instance Method Summary collapse
-
#initialize(path, plugin_name, plugin_config = {}) ⇒ SingleLine
constructor
A new instance of SingleLine.
- #matches ⇒ Object
Constructor Details
#initialize(path, plugin_name, plugin_config = {}) ⇒ SingleLine
Returns a new instance of SingleLine.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/regexp_preview/single_line.rb', line 5 def initialize(path, plugin_name, plugin_config = {}) @path = path @plugin_name = plugin_name.to_sym @plugin_config = plugin_config config = Fluent::Config::Element.new("ROOT", "", @plugin_config, []) @plugin = Fluent::Plugin.new_parser(@plugin_name).tap do |instance| instance.configure(config) end end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/regexp_preview/single_line.rb', line 3 def path @path end |
#plugin ⇒ Object (readonly)
Returns the value of attribute plugin.
3 4 5 |
# File 'lib/regexp_preview/single_line.rb', line 3 def plugin @plugin end |
#plugin_config ⇒ Object (readonly)
Returns the value of attribute plugin_config.
3 4 5 |
# File 'lib/regexp_preview/single_line.rb', line 3 def plugin_config @plugin_config end |
#plugin_name ⇒ Object (readonly)
Returns the value of attribute plugin_name.
3 4 5 |
# File 'lib/regexp_preview/single_line.rb', line 3 def plugin_name @plugin_name end |
Instance Method Details
#matches ⇒ Object
16 17 18 19 20 21 |
# File 'lib/regexp_preview/single_line.rb', line 16 def matches { pluginConfig: @plugin_config, matches: _matches } end |