Class: Bolt::ModuleInstaller::Specs::ID::Base
- Inherits:
-
Object
- Object
- Bolt::ModuleInstaller::Specs::ID::Base
- Defined in:
- lib/bolt/module_installer/specs/id/base.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#sha ⇒ Object
readonly
Returns the value of attribute sha.
Class Method Summary collapse
-
.request(git, ref, proxy) ⇒ Object
Request the name and SHA for a module and ref.
Instance Method Summary collapse
-
#initialize(name, sha) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(name, sha) ⇒ Base
Returns a new instance of Base.
19 20 21 22 |
# File 'lib/bolt/module_installer/specs/id/base.rb', line 19 def initialize(name, sha) @name = name @sha = sha end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/bolt/module_installer/specs/id/base.rb', line 14 def name @name end |
#sha ⇒ Object (readonly)
Returns the value of attribute sha.
14 15 16 |
# File 'lib/bolt/module_installer/specs/id/base.rb', line 14 def sha @sha end |
Class Method Details
.request(git, ref, proxy) ⇒ Object
Request the name and SHA for a module and ref. This method must return either an ID object or nil. The GitSpec class relies on this class to return an ID object to indicate the module was found, or nil to indicate that it should try to find it another way (such as cloning the repo).
34 35 36 37 |
# File 'lib/bolt/module_installer/specs/id/base.rb', line 34 def self.request(git, ref, proxy) name, sha = name_and_sha(git, ref, proxy) name && sha ? new(name, sha) : nil end |