Class: Vedeu::Colour
- Inherits:
-
Object
- Object
- Vedeu::Colour
- Defined in:
- lib/vedeu/models/colour.rb
Instance Method Summary collapse
- #attributes ⇒ Object
- #background ⇒ Object
- #foreground ⇒ Object
-
#initialize(attributes = {}) ⇒ Colour
constructor
A new instance of Colour.
- #to_s ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Colour
Returns a new instance of Colour.
3 4 5 |
# File 'lib/vedeu/models/colour.rb', line 3 def initialize(attributes = {}) @attributes = attributes end |
Instance Method Details
#attributes ⇒ Object
7 8 9 |
# File 'lib/vedeu/models/colour.rb', line 7 def attributes defaults.merge!(@attributes) end |
#background ⇒ Object
15 16 17 |
# File 'lib/vedeu/models/colour.rb', line 15 def background @background ||= ColourTranslator.new(attributes[:background]).background end |
#foreground ⇒ Object
11 12 13 |
# File 'lib/vedeu/models/colour.rb', line 11 def foreground @foreground ||= ColourTranslator.new(attributes[:foreground]).foreground end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/vedeu/models/colour.rb', line 19 def to_s foreground + background end |