Class: Fitment::Wheel
- Inherits:
-
Object
- Object
- Fitment::Wheel
- Defined in:
- lib/fitment/wheel.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#bolt_pattern ⇒ Object
Returns the value of attribute bolt_pattern.
-
#diameter ⇒ Object
readonly
Returns the value of attribute diameter.
-
#et ⇒ Object
readonly
Returns the value of attribute et.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(diameter_in, width_in, et = 0, bolt_pattern: "") ⇒ Wheel
constructor
A new instance of Wheel.
- #offset ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(diameter_in, width_in, et = 0, bolt_pattern: "") ⇒ Wheel
Returns a new instance of Wheel.
16 17 18 19 20 21 |
# File 'lib/fitment/wheel.rb', line 16 def initialize(diameter_in, width_in, et = 0, bolt_pattern: "") @diameter = diameter_in @width = width_in @et = et @bolt_pattern = bolt_pattern end |
Instance Attribute Details
#bolt_pattern ⇒ Object
Returns the value of attribute bolt_pattern.
14 15 16 |
# File 'lib/fitment/wheel.rb', line 14 def bolt_pattern @bolt_pattern end |
#diameter ⇒ Object (readonly)
Returns the value of attribute diameter.
13 14 15 |
# File 'lib/fitment/wheel.rb', line 13 def diameter @diameter end |
#et ⇒ Object (readonly)
Returns the value of attribute et.
13 14 15 |
# File 'lib/fitment/wheel.rb', line 13 def et @et end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
13 14 15 |
# File 'lib/fitment/wheel.rb', line 13 def width @width end |
Class Method Details
Instance Method Details
#offset ⇒ Object
27 28 29 |
# File 'lib/fitment/wheel.rb', line 27 def offset self.class.offset(@et, @width) end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/fitment/wheel.rb', line 23 def to_s "#{@diameter}x#{@width} ET#{et} #{@bolt_pattern}".strip end |