Class: DocRSpec::Ast::Example
- Inherits:
-
Object
- Object
- DocRSpec::Ast::Example
- Defined in:
- lib/doc_rspec/ast/example.rb
Instance Attribute Summary collapse
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#lnb ⇒ Object
readonly
Returns the value of attribute lnb.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
6 7 8 |
# File 'lib/doc_rspec/ast/example.rb', line 6 def lines @lines end |
#lnb ⇒ Object (readonly)
Returns the value of attribute lnb.
6 7 8 |
# File 'lib/doc_rspec/ast/example.rb', line 6 def lnb @lnb end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/doc_rspec/ast/example.rb', line 6 def name @name end |
Instance Method Details
#add(op, lhs, rhs) ⇒ Object
8 9 10 |
# File 'lib/doc_rspec/ast/example.rb', line 8 def add(op, lhs, rhs) lines << [op, lhs, rhs].compact end |
#it_name(path) ⇒ Object
12 13 14 |
# File 'lib/doc_rspec/ast/example.rb', line 12 def it_name(path) "#{name || "example from rdoc"} (#{path}:#{lnb})" end |