Class: DeprecatedOption

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(old, current) ⇒ DeprecatedOption

Returns a new instance of DeprecatedOption



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

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

Instance Attribute Details

#currentObject (readonly)

Returns the value of attribute current



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

def current
  @current
end

#oldObject (readonly)

Returns the value of attribute old



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

def old
  @old
end

Instance Method Details

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



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

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

#current_flagObject



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

def current_flag
  "--#{current}"
end

#old_flagObject



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

def old_flag
  "--#{old}"
end