Class: Hardhat::Dependency
- Inherits:
-
Object
- Object
- Hardhat::Dependency
- Defined in:
- lib/hardhat/dependency.rb
Instance Attribute Summary collapse
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#installers ⇒ Object
readonly
Returns the value of attribute installers.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ Dependency
constructor
A new instance of Dependency.
-
#inspect ⇒ Object
inspect -> String Debugging output for this dependency.
-
#sudo? ⇒ Boolean
sudo? -> Boolean Returns a boolean indicating if this dependency needs to be handled as root.
-
#to_s ⇒ Object
to_s -> String Returns the name of this dependency.
Constructor Details
#initialize(name, options = {}) ⇒ Dependency
Returns a new instance of Dependency.
5 6 7 8 9 10 11 12 13 |
# File 'lib/hardhat/dependency.rb', line 5 def initialize(name, ={}) unless .is_a? Hash raise ArgumentError.new "options should be a hash" end @name = name @installers = ([] << [:installer]).flatten.compact @sudo = [:sudo] @flags = [:flags] end |
Instance Attribute Details
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
3 4 5 |
# File 'lib/hardhat/dependency.rb', line 3 def flags @flags end |
#installers ⇒ Object (readonly)
Returns the value of attribute installers.
3 4 5 |
# File 'lib/hardhat/dependency.rb', line 3 def installers @installers end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/hardhat/dependency.rb', line 3 def name @name end |
Instance Method Details
#inspect ⇒ Object
inspect -> String Debugging output for this dependency
34 35 36 |
# File 'lib/hardhat/dependency.rb', line 34 def inspect "#<#{self.class}: #{self.name}>" end |
#sudo? ⇒ Boolean
sudo? -> Boolean Returns a boolean indicating if this dependency needs to be handled as root. This will overide installer defaults.
19 20 21 |
# File 'lib/hardhat/dependency.rb', line 19 def sudo? !!@sudo end |
#to_s ⇒ Object
to_s -> String Returns the name of this dependency. This is used when formatting the system call
27 28 29 |
# File 'lib/hardhat/dependency.rb', line 27 def to_s name end |