Class: TurboReady::StringWrapper
- Inherits:
-
Object
- Object
- TurboReady::StringWrapper
- Includes:
- TagHelper
- Defined in:
- lib/turbo_ready/string_wrapper.rb
Instance Attribute Summary collapse
-
#turbo_stream_string ⇒ Object
readonly
Returns the value of attribute turbo_stream_string.
Instance Method Summary collapse
-
#initialize(turbo_stream_string, turbo_stream_strings: Set.new) ⇒ StringWrapper
constructor
A new instance of StringWrapper.
- #invoke ⇒ Object
- #to_s ⇒ Object
Methods included from TagHelper
Constructor Details
#initialize(turbo_stream_string, turbo_stream_strings: Set.new) ⇒ StringWrapper
Returns a new instance of StringWrapper.
9 10 11 12 13 |
# File 'lib/turbo_ready/string_wrapper.rb', line 9 def initialize(turbo_stream_string, turbo_stream_strings: Set.new) @turbo_stream_string = turbo_stream_string @turbo_stream_strings = turbo_stream_strings @turbo_stream_strings << turbo_stream_string end |
Instance Attribute Details
#turbo_stream_string ⇒ Object (readonly)
Returns the value of attribute turbo_stream_string.
5 6 7 |
# File 'lib/turbo_ready/string_wrapper.rb', line 5 def turbo_stream_string @turbo_stream_string end |
Instance Method Details
#invoke ⇒ Object
15 16 17 |
# File 'lib/turbo_ready/string_wrapper.rb', line 15 def invoke(...) TurboReady::StringWrapper.new turbo_stream_invoke_tag(...), turbo_stream_strings: turbo_stream_strings end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/turbo_ready/string_wrapper.rb', line 19 def to_s turbo_stream_strings.to_a.join("\n").html_safe end |