Class: Remi::Testing::BusinessRules::DataExampleCollection
- Inherits:
-
Object
- Object
- Remi::Testing::BusinessRules::DataExampleCollection
- Includes:
- Enumerable
- Defined in:
- lib/remi/testing/business_rules.rb
Instance Method Summary collapse
- #[](example_name) ⇒ Object
- #add_example(example_name, example_table) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize ⇒ DataExampleCollection
constructor
A new instance of DataExampleCollection.
- #keys ⇒ Object
Constructor Details
#initialize ⇒ DataExampleCollection
Returns a new instance of DataExampleCollection.
503 504 505 |
# File 'lib/remi/testing/business_rules.rb', line 503 def initialize @examples = {} end |
Instance Method Details
#[](example_name) ⇒ Object
507 508 509 |
# File 'lib/remi/testing/business_rules.rb', line 507 def [](example_name) @examples[example_name] end |
#add_example(example_name, example_table) ⇒ Object
519 520 521 |
# File 'lib/remi/testing/business_rules.rb', line 519 def add_example(example_name, example_table) @examples[example_name] = DataExample.new(example_table) unless @examples.include? example_name end |
#each(&block) ⇒ Object
511 512 513 |
# File 'lib/remi/testing/business_rules.rb', line 511 def each(&block) @examples.each(&block) end |
#keys ⇒ Object
515 516 517 |
# File 'lib/remi/testing/business_rules.rb', line 515 def keys @examples.keys end |