Class: Gamefic::SceneData::YesOrNo

Inherits:
Base
  • Object
show all
Defined in:
lib/gamefic/scene_data/yes_or_no.rb

Instance Attribute Summary

Attributes inherited from Base

#input

Instance Method Summary collapse

Instance Method Details

#invalid_messageObject



13
14
15
# File 'lib/gamefic/scene_data/yes_or_no.rb', line 13

def invalid_message
  @invalid_message ||= 'Please enter Yes or No.'
end

#no?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/gamefic/scene_data/yes_or_no.rb', line 7

def no?
  input.to_s[0,1].downcase == 'n'
end

#promptObject



10
11
12
# File 'lib/gamefic/scene_data/yes_or_no.rb', line 10

def prompt
  @prompt ||= 'Yes or No?'
end

#yes?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/gamefic/scene_data/yes_or_no.rb', line 4

def yes?
  input.to_s[0,1].downcase == 'y'
end