Class: Mack::Utils::GemManager::GemObject
- Defined in:
- lib/mack/utils/gem_manager.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#libs ⇒ Object
Returns the value of attribute libs.
-
#name ⇒ Object
Returns the value of attribute name.
-
#source ⇒ Object
Returns the value of attribute source.
-
#tasks ⇒ Object
Returns the value of attribute tasks.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ GemObject
constructor
A new instance of GemObject.
- #libs? ⇒ Boolean
- #source? ⇒ Boolean
- #tasks? ⇒ Boolean
- #to_s ⇒ Object
- #version? ⇒ Boolean
Constructor Details
#initialize(name, options = {}) ⇒ GemObject
Returns a new instance of GemObject.
71 72 73 74 75 76 77 |
# File 'lib/mack/utils/gem_manager.rb', line 71 def initialize(name, = {}) self.name = name self.version = [:version] self.libs = [[:libs]].flatten.compact self.tasks = [[:tasks], "#{name}_tasks"].flatten.compact self.source = [:source] end |
Instance Attribute Details
#libs ⇒ Object
Returns the value of attribute libs.
67 68 69 |
# File 'lib/mack/utils/gem_manager.rb', line 67 def libs @libs end |
#name ⇒ Object
Returns the value of attribute name.
65 66 67 |
# File 'lib/mack/utils/gem_manager.rb', line 65 def name @name end |
#source ⇒ Object
Returns the value of attribute source.
69 70 71 |
# File 'lib/mack/utils/gem_manager.rb', line 69 def source @source end |
#tasks ⇒ Object
Returns the value of attribute tasks.
68 69 70 |
# File 'lib/mack/utils/gem_manager.rb', line 68 def tasks @tasks end |
#version ⇒ Object
Returns the value of attribute version.
66 67 68 |
# File 'lib/mack/utils/gem_manager.rb', line 66 def version @version end |
Instance Method Details
#libs? ⇒ Boolean
85 86 87 |
# File 'lib/mack/utils/gem_manager.rb', line 85 def libs? self.libs.any? end |
#source? ⇒ Boolean
93 94 95 |
# File 'lib/mack/utils/gem_manager.rb', line 93 def source? !self.source.blank? end |
#tasks? ⇒ Boolean
97 98 99 |
# File 'lib/mack/utils/gem_manager.rb', line 97 def tasks? self.tasks.any? end |
#to_s ⇒ Object
79 80 81 82 83 |
# File 'lib/mack/utils/gem_manager.rb', line 79 def to_s t = self.name.to_s t << "-#{self.version}" if self.version? t.downcase end |
#version? ⇒ Boolean
89 90 91 |
# File 'lib/mack/utils/gem_manager.rb', line 89 def version? !self.version.blank? end |