Exception: Yay::TooManyColoursError
- Defined in:
- lib/yay/errors.rb
Instance Attribute Summary collapse
-
#bg ⇒ Object
readonly
Returns the value of attribute bg.
-
#colour ⇒ Object
readonly
Returns the value of attribute colour.
-
#fg ⇒ Object
readonly
Returns the value of attribute fg.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(fg, bg, colour, position) ⇒ TooManyColoursError
constructor
A new instance of TooManyColoursError.
- #printable_message ⇒ Object
Methods inherited from Error
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
#bg ⇒ Object (readonly)
Returns the value of attribute bg.
89 90 91 |
# File 'lib/yay/errors.rb', line 89 def bg @bg end |
#colour ⇒ Object (readonly)
Returns the value of attribute colour.
90 91 92 |
# File 'lib/yay/errors.rb', line 90 def colour @colour end |
#fg ⇒ Object (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_message ⇒ Object
99 100 101 |
# File 'lib/yay/errors.rb', line 99 def 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 |