Class: Sourcify::Proc::Scanner::Heredoc
- Inherits:
-
Struct
- Object
- Struct
- Sourcify::Proc::Scanner::Heredoc
- Defined in:
- lib/sourcify/proc/scanner/heredoc.rb
Instance Attribute Summary collapse
-
#indented ⇒ Object
Returns the value of attribute indented.
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
Instance Attribute Details
#indented ⇒ Object
Returns the value of attribute indented
4 5 6 |
# File 'lib/sourcify/proc/scanner/heredoc.rb', line 4 def indented @indented end |
#tag ⇒ Object
Returns the value of attribute tag
4 5 6 |
# File 'lib/sourcify/proc/scanner/heredoc.rb', line 4 def tag @tag end |
Instance Method Details
#<<(content) ⇒ Object
6 7 8 |
# File 'lib/sourcify/proc/scanner/heredoc.rb', line 6 def <<(content) (@contents ||= []) << content end |
#closed?(sealer) ⇒ Boolean
14 15 16 17 18 19 |
# File 'lib/sourcify/proc/scanner/heredoc.rb', line 14 def closed?(sealer) return false unless sealer == "\n" parts = @contents[-1].split("\n") return true if parts[-1] == tag indented && parts[-1].sub(/^\s*(.*)$/,'\1') == tag end |
#to_s ⇒ Object
10 11 12 |
# File 'lib/sourcify/proc/scanner/heredoc.rb', line 10 def to_s @contents.join end |