Class: Bundler::Overrule::Force

Inherits:
Rule
  • Object
show all
Defined in:
lib/bundler/overrule/rule.rb

Overview

force 'openssl', '>= 3.0' — rewrite every constraint on this gem.

Instance Attribute Summary collapse

Attributes inherited from Rule

#name, #reason

Instance Method Summary collapse

Methods inherited from Rule

#==, #applies_to?, #hash

Constructor Details

#initialize(name, requirement, reason: nil) ⇒ Force

Returns a new instance of Force.



72
73
74
75
# File 'lib/bundler/overrule/rule.rb', line 72

def initialize(name, requirement, reason: nil)
  @requirement = build_requirement(requirement)
  super(name, reason: reason)
end

Instance Attribute Details

#requirementObject (readonly)

Returns the value of attribute requirement.



70
71
72
# File 'lib/bundler/overrule/rule.rb', line 70

def requirement
  @requirement
end

Instance Method Details

#comparable_requirementObject



81
82
83
# File 'lib/bundler/overrule/rule.rb', line 81

def comparable_requirement
  requirement.to_s
end

#to_sObject



85
86
87
# File 'lib/bundler/overrule/rule.rb', line 85

def to_s
  "force #{name} #{requirement}"
end

#typeObject



77
78
79
# File 'lib/bundler/overrule/rule.rb', line 77

def type
  :force
end