Module: Streamlined::Helpers::TouchableProc
- Defined in:
- lib/streamlined/helpers.rb
Instance Attribute Summary collapse
-
#touched ⇒ Object
Returns the value of attribute touched.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#touched ⇒ Object
Returns the value of attribute touched.
8 9 10 |
# File 'lib/streamlined/helpers.rb', line 8 def touched @touched end |
Class Method Details
.run_through_pipeline(in_context_binding, input, callback) ⇒ Object
10 11 12 13 14 |
# File 'lib/streamlined/helpers.rb', line 10 def self.run_through_pipeline(in_context_binding, input, callback) Serbea::Pipeline.new(in_context_binding, input).tap { _1.instance_exec(&callback) }.then do |pipeline| -> { pipeline.value } end end |
Instance Method Details
#encode ⇒ Object
36 37 38 |
# File 'lib/streamlined/helpers.rb', line 36 def encode(...) to_s.encode(...) end |
#html_safe ⇒ Object
21 22 23 24 |
# File 'lib/streamlined/helpers.rb', line 21 def html_safe @html_safe = true self end |
#html_safe? ⇒ Boolean
26 27 28 |
# File 'lib/streamlined/helpers.rb', line 26 def html_safe? @html_safe == true end |
#to_s ⇒ Object
30 31 32 33 34 |
# File 'lib/streamlined/helpers.rb', line 30 def to_s return self.().to_s.then { html_safe? ? _1.html_safe : _1 } if touched super end |
#touch ⇒ Object
16 17 18 19 |
# File 'lib/streamlined/helpers.rb', line 16 def touch self.touched = true self end |