Class: DocRSpec::Ast::Example

Inherits:
Object
  • Object
show all
Defined in:
lib/doc_rspec/ast/example.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



6
7
8
# File 'lib/doc_rspec/ast/example.rb', line 6

def lines
  @lines
end

#lnbObject (readonly)

Returns the value of attribute lnb.



6
7
8
# File 'lib/doc_rspec/ast/example.rb', line 6

def lnb
  @lnb
end

#nameObject (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