class SameBoat::Crews

Public Class Methods

new(crews, journal_path:) click to toggle source
# File lib/same_boat/crews.rb, line 3
def initialize(crews, journal_path:)
  @crews, @journal_path = crews, journal_path
end

Public Instance Methods

call_over() click to toggle source
# File lib/same_boat/crews.rb, line 15
def call_over
  @crews.map { |crew| "#{crew.name}: #{crew.present}" }.join
end
journal() click to toggle source
# File lib/same_boat/crews.rb, line 11
def journal
  File.write(@journal_path, call_over)
end
past_travel() click to toggle source
# File lib/same_boat/crews.rb, line 19
def past_travel
  File.exist?(@journal_path) ? File.read(@journal_path) : ''
end
row() click to toggle source
# File lib/same_boat/crews.rb, line 7
def row
  call_over == past_travel
end