Class: DeprecatedOption

Inherits:
Object
  • Object
show all
Defined in:
brew/Library/Homebrew/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(old, current) ⇒ DeprecatedOption

Returns a new instance of DeprecatedOption



39
40
41
42
# File 'brew/Library/Homebrew/options.rb', line 39

def initialize(old, current)
  @old = old
  @current = current
end

Instance Attribute Details

#currentObject (readonly)

Returns the value of attribute current



37
38
39
# File 'brew/Library/Homebrew/options.rb', line 37

def current
  @current
end

#oldObject (readonly)

Returns the value of attribute old



37
38
39
# File 'brew/Library/Homebrew/options.rb', line 37

def old
  @old
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



52
53
54
# File 'brew/Library/Homebrew/options.rb', line 52

def ==(other)
  instance_of?(other.class) && old == other.old && current == other.current
end

#current_flagObject



48
49
50
# File 'brew/Library/Homebrew/options.rb', line 48

def current_flag
  "--#{current}"
end

#old_flagObject



44
45
46
# File 'brew/Library/Homebrew/options.rb', line 44

def old_flag
  "--#{old}"
end