Class: Fitment::OffsetWheel

Inherits:
Wheel
  • Object
show all
Defined in:
lib/fitment/wheel.rb

Instance Attribute Summary collapse

Attributes inherited from Wheel

#bolt_pattern, #diameter, #width

Instance Method Summary collapse

Methods inherited from Wheel

et, offset

Constructor Details

#initialize(diameter_in, width_in, offset_in, bolt_pattern: "") ⇒ OffsetWheel

Returns a new instance of OffsetWheel.



35
36
37
38
39
40
# File 'lib/fitment/wheel.rb', line 35

def initialize(diameter_in, width_in, offset_in, bolt_pattern: "")
  @diameter = diameter_in
  @width = width_in
  @offset = offset_in
  @bolt_pattern = bolt_pattern
end

Instance Attribute Details

#offsetObject (readonly)

Returns the value of attribute offset.



33
34
35
# File 'lib/fitment/wheel.rb', line 33

def offset
  @offset
end

Instance Method Details

#etObject



46
47
48
# File 'lib/fitment/wheel.rb', line 46

def et
  self.class.et(@offset, @width)
end

#to_sObject



42
43
44
# File 'lib/fitment/wheel.rb', line 42

def to_s
  "#{@diameter}x#{@width} #{@offset}\" offset  #{@bolt_pattern}".strip
end