Class: Option Private
Overview
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
A formula option.
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
private
-
#flag ⇒ Object
readonly
private
-
#name ⇒ Object
readonly
private
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
private
-
#==(other) ⇒ Object
(also: #eql?)
private
-
#hash ⇒ Object
private
-
#initialize(name, description = "") ⇒ Option
constructor
private
A new instance of Option.
-
#inspect ⇒ String
private
-
#to_s ⇒ Object
private
Constructor Details
#initialize(name, description = "") ⇒ Option
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
Returns a new instance of Option.
10 11 12 13 14 |
# File 'options.rb', line 10 def initialize(name, description = "") @name = name @flag = "--#{name}" @description = description end |
Instance Attribute Details
#description ⇒ Object (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
8 9 10 |
# File 'options.rb', line 8 def description @description end |
#flag ⇒ Object (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
8 9 10 |
# File 'options.rb', line 8 def flag @flag end |
#name ⇒ Object (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
8 9 10 |
# File 'options.rb', line 8 def name @name end |
Instance Method Details
#<=>(other) ⇒ Object
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
20 21 22 23 24 |
# File 'options.rb', line 20 def <=>(other) return unless other.is_a?(Option) name <=> other.name end |
#==(other) ⇒ Object Also known as: eql?
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
26 27 28 |
# File 'options.rb', line 26 def ==(other) instance_of?(other.class) && name == other.name end |
#hash ⇒ Object
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
31 32 33 |
# File 'options.rb', line 31 def hash name.hash end |
#inspect ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
36 37 38 |
# File 'options.rb', line 36 def inspect "#<#{self.class.name}: #{flag.inspect}>" end |
#to_s ⇒ Object
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
16 17 18 |
# File 'options.rb', line 16 def to_s flag end |