Class: PryTheme::TERM Private
- Inherits:
-
Object
- Object
- PryTheme::TERM
- Defined in:
- lib/pry-theme/term.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents a terminal colour (not ANSI). Checks whether a number fits in its colour model.
Instance Attribute Summary collapse
-
#color_model ⇒ Integer
readonly
private
The values are 8, 16 or 256.
Instance Method Summary collapse
-
#initialize(value, color_model = 256) ⇒ TERM
constructor
private
A new instance of TERM.
- #inspect ⇒ String private
- #to_i ⇒ Integer private
Constructor Details
#initialize(value, color_model = 256) ⇒ TERM
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of TERM.
14 15 16 17 18 |
# File 'lib/pry-theme/term.rb', line 14 def initialize(value, color_model = 256) validate_attrs(value, color_model) @value = value @color_model = color_model end |
Instance Attribute Details
#color_model ⇒ Integer (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the values are 8, 16 or 256.
10 11 12 |
# File 'lib/pry-theme/term.rb', line 10 def color_model @color_model end |
Instance Method Details
#inspect ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 |
# File 'lib/pry-theme/term.rb', line 21 def inspect "(TERM-#{ @color_model }: #{ @value })" end |
#to_i ⇒ Integer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/pry-theme/term.rb', line 26 def to_i @value end |