Class: Dive

Inherits:
Object
  • Object
show all
Defined in:
lib/subsurface/dive.rb

Overview

Dive is the model that contains all the information for each dive

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(number, date, time, duration, o2_percent, computer_data) ⇒ Dive

rubocop:disable Metrics/ParameterLists

Parameters:

  • number (Integer)
  • date (String)
  • time (String)
  • duration (Integer)

    in seconds

  • o2_percent= (Integer)
  • computer_data (ComputerData)


14
15
16
17
18
19
20
21
# File 'lib/subsurface/dive.rb', line 14

def initialize(number, date, time, duration, o2_percent, computer_data)
  @number = number
  @date = date
  @time = time
  @duration = duration
  @o2_percent = o2_percent
  @computer_data = computer_data
end

Instance Attribute Details

#computer_dataObject (readonly)

Returns the value of attribute computer_data.



5
6
7
# File 'lib/subsurface/dive.rb', line 5

def computer_data
  @computer_data
end

#dateObject (readonly)

Returns the value of attribute date.



5
6
7
# File 'lib/subsurface/dive.rb', line 5

def date
  @date
end

#durationObject (readonly)

Returns the value of attribute duration.



5
6
7
# File 'lib/subsurface/dive.rb', line 5

def duration
  @duration
end

#numberObject (readonly)

Returns the value of attribute number.



5
6
7
# File 'lib/subsurface/dive.rb', line 5

def number
  @number
end

#o2_percentObject (readonly)

Returns the value of attribute o2_percent.



5
6
7
# File 'lib/subsurface/dive.rb', line 5

def o2_percent
  @o2_percent
end

#timeObject (readonly)

Returns the value of attribute time.



5
6
7
# File 'lib/subsurface/dive.rb', line 5

def time
  @time
end