class BodyMassIndex

Attributes

height[R]
mass[R]

Public Class Methods

new(height:, mass:) click to toggle source
# File lib/body_mass_index.rb, line 4
def initialize(height:, mass:)
  @height, @mass = height, mass
end

Public Instance Methods

calculate_index() click to toggle source
# File lib/body_mass_index.rb, line 8
def calculate_index
  (mass / (height ** 2)).round(2)
end