Module: Lottery::LotteryPPrint

Included in:
Hash
Defined in:
lib/lottery/helper.rb

Instance Method Summary collapse

Instance Method Details

#newlineObject



23
24
25
# File 'lib/lottery/helper.rb', line 23

def newline
  puts
end

#pprint(first_name: 'Numbers', second_name: 'Lucky Numbers') ⇒ Object



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

def pprint(first_name: 'Numbers', second_name: 'Lucky Numbers')
  printf "%s: %s ", first_name, self[:first]
  if self[:second].nil?
    newline
  else
    printf "%s: %s\n", second_name, self[:second]
  end
end