Class: RSpec::Contracts::Interface
- Inherits:
-
Object
- Object
- RSpec::Contracts::Interface
- Defined in:
- lib/rspec/contracts/interface.rb
Instance Attribute Summary collapse
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #add_message(message) ⇒ Object
-
#initialize(name) ⇒ Interface
constructor
A new instance of Interface.
- #unique_messages ⇒ Object
Constructor Details
#initialize(name) ⇒ Interface
Returns a new instance of Interface.
8 9 10 11 |
# File 'lib/rspec/contracts/interface.rb', line 8 def initialize(name) @name = name = [] end |
Instance Attribute Details
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
6 7 8 |
# File 'lib/rspec/contracts/interface.rb', line 6 def end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/rspec/contracts/interface.rb', line 6 def name @name end |
Class Method Details
.all ⇒ Object
17 18 19 |
# File 'lib/rspec/contracts/interface.rb', line 17 def self.all @all ||= InterfaceGroup.new end |
.find_or_create(name) ⇒ Object
21 22 23 |
# File 'lib/rspec/contracts/interface.rb', line 21 def self.find_or_create(name) all.find_or_create name end |
Instance Method Details
#add_message(message) ⇒ Object
13 14 15 |
# File 'lib/rspec/contracts/interface.rb', line 13 def () << end |
#unique_messages ⇒ Object
25 26 27 |
# File 'lib/rspec/contracts/interface.rb', line 25 def .uniq(&:to_hash) end |