Exception: Yay::TooManyColoursError

Inherits:
Error
  • Object
show all
Defined in:
lib/yay/errors.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#position

Instance Method Summary collapse

Methods inherited from Error

#printable_position

Constructor Details

#initialize(fg, bg, colour, position) ⇒ TooManyColoursError

Returns a new instance of TooManyColoursError.



92
93
94
95
96
97
# File 'lib/yay/errors.rb', line 92

def initialize fg, bg, colour, position
  @fg       = fg
  @bg       = bg
  @colour   = colour
  @position = position
end

Instance Attribute Details

#bgObject (readonly)

Returns the value of attribute bg.



89
90
91
# File 'lib/yay/errors.rb', line 89

def bg
  @bg
end

#colourObject (readonly)

Returns the value of attribute colour.



90
91
92
# File 'lib/yay/errors.rb', line 90

def colour
  @colour
end

#fgObject (readonly)

Returns the value of attribute fg.



88
89
90
# File 'lib/yay/errors.rb', line 88

def fg
  @fg
end

Instance Method Details

#printable_messageObject



99
100
101
# File 'lib/yay/errors.rb', line 99

def printable_message
  return "There were too many colours in your expression#{printable_position}.\nYou can't use #{colour} as you've already chosen a foreground and background colour"
end