Class: ShortBus::Spec
- Inherits:
-
Object
- Object
- ShortBus::Spec
- Defined in:
- lib/short_bus/spec.rb
Overview
Used for message_specs and publisher_specs
Instance Attribute Summary collapse
-
#specs ⇒ Object
readonly
Returns the value of attribute specs.
Instance Method Summary collapse
- #<<(spec) ⇒ Object
- #delete(spec) ⇒ Object
-
#initialize(spec = nil) ⇒ Spec
constructor
A new instance of Spec.
- #match(item) ⇒ Object
Constructor Details
#initialize(spec = nil) ⇒ Spec
Returns a new instance of Spec.
10 11 12 |
# File 'lib/short_bus/spec.rb', line 10 def initialize(spec = nil) @specs = process(spec) end |
Instance Attribute Details
#specs ⇒ Object (readonly)
Returns the value of attribute specs.
8 9 10 |
# File 'lib/short_bus/spec.rb', line 8 def specs @specs end |
Instance Method Details
#<<(spec) ⇒ Object
14 15 16 |
# File 'lib/short_bus/spec.rb', line 14 def <<(spec) @specs += process(spec) end |
#delete(spec) ⇒ Object
18 19 20 |
# File 'lib/short_bus/spec.rb', line 18 def delete(spec) @specs.delete spec end |
#match(item) ⇒ Object
22 23 24 |
# File 'lib/short_bus/spec.rb', line 22 def match(item) @specs.reduce(false) { |a, e| a || match_single(e, item) } end |