Class: Taksi::Interface
- Inherits:
-
Module
- Object
- Module
- Taksi::Interface
- Defined in:
- lib/taksi/interface.rb
Defined Under Namespace
Modules: ClassMethods, InstanceMethods
Instance Attribute Summary collapse
-
#alternatives ⇒ Object
readonly
Returns the value of attribute alternatives.
-
#interface_name ⇒ Object
readonly
Returns the value of attribute interface_name.
-
#version_pattern ⇒ Object
readonly
Returns the value of attribute version_pattern.
Class Method Summary collapse
Instance Method Summary collapse
- #included(klass) ⇒ Object
-
#initialize(name, version_pattern = nil, alternatives: nil) ⇒ Interface
constructor
A new instance of Interface.
Constructor Details
#initialize(name, version_pattern = nil, alternatives: nil) ⇒ Interface
Returns a new instance of Interface.
11 12 13 14 15 16 |
# File 'lib/taksi/interface.rb', line 11 def initialize(name, version_pattern = nil, alternatives: nil) @interface_name = name @version_pattern = ::Gem::Requirement.new(version_pattern) @alternatives = alternatives super() end |
Instance Attribute Details
#alternatives ⇒ Object (readonly)
Returns the value of attribute alternatives.
5 6 7 |
# File 'lib/taksi/interface.rb', line 5 def alternatives @alternatives end |
#interface_name ⇒ Object (readonly)
Returns the value of attribute interface_name.
5 6 7 |
# File 'lib/taksi/interface.rb', line 5 def interface_name @interface_name end |
#version_pattern ⇒ Object (readonly)
Returns the value of attribute version_pattern.
5 6 7 |
# File 'lib/taksi/interface.rb', line 5 def version_pattern @version_pattern end |
Class Method Details
Instance Method Details
#included(klass) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/taksi/interface.rb', line 18 def included(klass) klass.extend(ClassMethods) klass.include(InstanceMethods) klass.initiate(self) ::Taksi::Registry.add(klass, interface_name) end |