Module: Lime::Featurette
- Defined in:
- lib/lime/featurette.rb
Overview
Convenience method for creating a feature mixin.
Class Method Summary collapse
Instance Method Summary collapse
-
#[](key) ⇒ Object
Access to advice.
-
#Given(description, &procedure) ⇒ Object
(also: #given)
Given …
-
#Then(description, &procedure) ⇒ Object
(also: #hence)
Then …
-
#When(description, &procedure) ⇒ Object
(also: #wence)
When …
Class Method Details
.append_features(base) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/lime/featurette.rb', line 21 def self.append_features(base) base.extend(self) base.module_eval %{ @_advice = Hash.new{ |h,k| h[k] = {} } } end |
Instance Method Details
#[](key) ⇒ Object
Access to advice.
62 63 64 |
# File 'lib/lime/featurette.rb', line 62 def [](key) @_advice[key] end |
#Given(description, &procedure) ⇒ Object Also known as: given
Given …
33 34 35 |
# File 'lib/lime/featurette.rb', line 33 def Given(description, &procedure) @_advice[:given][description] = procedure end |
#Then(description, &procedure) ⇒ Object Also known as: hence
Then …
55 56 57 |
# File 'lib/lime/featurette.rb', line 55 def Then(description, &procedure) @_advice[:then][description] = procedure end |
#When(description, &procedure) ⇒ Object Also known as: wence
When …
44 45 46 |
# File 'lib/lime/featurette.rb', line 44 def When(description, &procedure) @_advice[:when][description] = procedure end |