Class: BundleHack::Gem
- Inherits:
-
Object
- Object
- BundleHack::Gem
- Defined in:
- lib/bundle_hack/gem.rb
Instance Attribute Summary collapse
-
#full_name ⇒ Object
readonly
Returns the value of attribute full_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(definitions, options = {}) ⇒ Gem
constructor
A new instance of Gem.
- #locations ⇒ Object
- #params ⇒ Object
Constructor Details
#initialize(definitions, options = {}) ⇒ Gem
Returns a new instance of Gem.
7 8 9 10 11 12 13 |
# File 'lib/bundle_hack/gem.rb', line 7 def initialize(definitions, = {}) @definitions = definitions @name = .fetch(:name) @full_name = .fetch(:full_name) @version = normalized_version(.fetch(:version)) @path = Pathname.new(.fetch(:path)) end |
Instance Attribute Details
#full_name ⇒ Object (readonly)
Returns the value of attribute full_name.
5 6 7 |
# File 'lib/bundle_hack/gem.rb', line 5 def full_name @full_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/bundle_hack/gem.rb', line 5 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/bundle_hack/gem.rb', line 5 def path @path end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
5 6 7 |
# File 'lib/bundle_hack/gem.rb', line 5 def version @version end |
Instance Method Details
#locations ⇒ Object
15 16 17 |
# File 'lib/bundle_hack/gem.rb', line 15 def locations @definitions.map { |definition| definition[:locations] }.flatten end |
#params ⇒ Object
19 20 21 |
# File 'lib/bundle_hack/gem.rb', line 19 def params find_params || {} end |