Exception: Yay::TooManyColoursError
- Defined in:
- lib/yay/errors.rb
Overview
raised when a colour sequence was malformed. in practice you can use infinite colour commands but zero to two actual colours, the first one will be the foreground and the second one will be the background
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.
145 146 147 148 149 150 |
# File 'lib/yay/errors.rb', line 145 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.
142 143 144 |
# File 'lib/yay/errors.rb', line 142 def bg @bg end |
#colour ⇒ Object (readonly)
Returns the value of attribute colour.
143 144 145 |
# File 'lib/yay/errors.rb', line 143 def colour @colour end |
#fg ⇒ Object (readonly)
Returns the value of attribute fg.
141 142 143 |
# File 'lib/yay/errors.rb', line 141 def fg @fg end |
Instance Method Details
#printable_message ⇒ Object
152 153 154 |
# File 'lib/yay/errors.rb', line 152 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 |