Class: Yamlt::Parser::Line
- Inherits:
-
Object
- Object
- Yamlt::Parser::Line
- Defined in:
- lib/yamlt/parser/line.rb,
lib/yamlt/parser/line/serializer.rb
Defined Under Namespace
Classes: Serializer
Instance Attribute Summary collapse
-
#anchor ⇒ Object
readonly
Returns the value of attribute anchor.
-
#clean ⇒ Object
readonly
Returns the value of attribute clean.
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#comment_prefix ⇒ Object
readonly
Returns the value of attribute comment_prefix.
-
#fragment ⇒ Object
readonly
Returns the value of attribute fragment.
-
#full_path ⇒ Object
Returns the value of attribute full_path.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#multiline ⇒ Object
readonly
Returns the value of attribute multiline.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #as_text(opts = {}) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(text) ⇒ Line
constructor
A new instance of Line.
Constructor Details
#initialize(text) ⇒ Line
Returns a new instance of Line.
11 12 13 14 |
# File 'lib/yamlt/parser/line.rb', line 11 def initialize(text) @text = text parse end |
Instance Attribute Details
#anchor ⇒ Object (readonly)
Returns the value of attribute anchor.
16 17 18 |
# File 'lib/yamlt/parser/line.rb', line 16 def anchor @anchor end |
#clean ⇒ Object (readonly)
Returns the value of attribute clean.
16 17 18 |
# File 'lib/yamlt/parser/line.rb', line 16 def clean @clean end |
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
16 17 18 |
# File 'lib/yamlt/parser/line.rb', line 16 def comment @comment end |
#comment_prefix ⇒ Object (readonly)
Returns the value of attribute comment_prefix.
17 18 19 |
# File 'lib/yamlt/parser/line.rb', line 17 def comment_prefix @comment_prefix end |
#fragment ⇒ Object (readonly)
Returns the value of attribute fragment.
16 17 18 |
# File 'lib/yamlt/parser/line.rb', line 16 def fragment @fragment end |
#full_path ⇒ Object
Returns the value of attribute full_path.
18 19 20 |
# File 'lib/yamlt/parser/line.rb', line 18 def full_path @full_path end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
16 17 18 |
# File 'lib/yamlt/parser/line.rb', line 16 def level @level end |
#multiline ⇒ Object (readonly)
Returns the value of attribute multiline.
16 17 18 |
# File 'lib/yamlt/parser/line.rb', line 16 def multiline @multiline end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
16 17 18 |
# File 'lib/yamlt/parser/line.rb', line 16 def prefix @prefix end |
#value ⇒ Object
Returns the value of attribute value.
18 19 20 |
# File 'lib/yamlt/parser/line.rb', line 18 def value @value end |
Instance Method Details
#as_text(opts = {}) ⇒ Object
21 22 23 24 |
# File 'lib/yamlt/parser/line.rb', line 21 def as_text(opts={}) serializer = Serializer.new(self, opts) serializer.to_s end |
#empty? ⇒ Boolean
26 27 28 |
# File 'lib/yamlt/parser/line.rb', line 26 def empty? !@fragment && !@value end |