Class: Manacle::ExampleList
- Inherits:
-
Object
- Object
- Manacle::ExampleList
- Includes:
- ERB::Util
- Defined in:
- lib/manacle/formatter.rb
Instance Attribute Summary collapse
-
#examples ⇒ Object
readonly
Returns the value of attribute examples.
Instance Method Summary collapse
- #add(example, last_response) ⇒ Object
-
#initialize ⇒ ExampleList
constructor
A new instance of ExampleList.
- #pretty_xml(xml) ⇒ Object
- #render ⇒ Object
Constructor Details
#initialize ⇒ ExampleList
Returns a new instance of ExampleList.
65 66 67 |
# File 'lib/manacle/formatter.rb', line 65 def initialize @examples = [] end |
Instance Attribute Details
#examples ⇒ Object (readonly)
Returns the value of attribute examples.
63 64 65 |
# File 'lib/manacle/formatter.rb', line 63 def examples @examples end |
Instance Method Details
#add(example, last_response) ⇒ Object
69 70 71 |
# File 'lib/manacle/formatter.rb', line 69 def add(example, last_response) @examples << Example.new(example, last_response) end |
#pretty_xml(xml) ⇒ Object
73 74 75 |
# File 'lib/manacle/formatter.rb', line 73 def pretty_xml(xml) Nokogiri::XML(xml,&:noblanks).to_xml unless xml.nil? end |
#render ⇒ Object
77 78 79 80 |
# File 'lib/manacle/formatter.rb', line 77 def render erb = ERB.new(File.read(File.('report.erb',__dir__))) erb.result(binding) end |