Class: DocRSpec::Context::Example

Inherits:
Object
  • Object
show all
Defined in:
lib/doc_rspec/context/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/context/example.rb', line 6

def lines
  @lines
end

#lnbObject (readonly)

Returns the value of attribute lnb.



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

def lnb
  @lnb
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#add(code) ⇒ Object



8
9
10
# File 'lib/doc_rspec/context/example.rb', line 8

def add(code)
  lines << code
end

#empty?Boolean

Returns:



16
# File 'lib/doc_rspec/context/example.rb', line 16

def empty? = lines.empty?

#it_name(path) ⇒ Object



12
13
14
# File 'lib/doc_rspec/context/example.rb', line 12

def it_name(path)
  "#{name || "example from rdoc"} (#{path}:#{lnb})"
end