Class: HaveAPI::ExampleList
- Inherits:
-
Object
- Object
- HaveAPI::ExampleList
- Includes:
- Enumerable
- Defined in:
- lib/haveapi/example_list.rb
Instance Method Summary collapse
- #<<(example) ⇒ Object
- #describe(context) ⇒ Object
- #each ⇒ Object
-
#initialize ⇒ ExampleList
constructor
A new instance of ExampleList.
Constructor Details
#initialize ⇒ ExampleList
Returns a new instance of ExampleList.
3 4 5 |
# File 'lib/haveapi/example_list.rb', line 3 def initialize @examples = [] end |
Instance Method Details
#<<(example) ⇒ Object
8 9 10 |
# File 'lib/haveapi/example_list.rb', line 8 def <<(example) @examples << example end |
#describe(context) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/haveapi/example_list.rb', line 12 def describe(context) ret = [] @examples.each do |e| ret << e.describe(context) if e.(context) end ret end |
#each ⇒ Object
22 23 24 |
# File 'lib/haveapi/example_list.rb', line 22 def each(&) @examples.each(&) end |