Class: Kuler::Swatch
- Inherits:
-
Object
- Object
- Kuler::Swatch
- Defined in:
- lib/kuler/swatch.rb
Instance Attribute Summary collapse
-
#hex_code ⇒ Object
the hex code of the color swatch.
Instance Method Summary collapse
-
#initialize(input) ⇒ Swatch
constructor
create a new Kuler::Swatch from a Nokogiri::XML::Element.
Constructor Details
#initialize(input) ⇒ Swatch
create a new Kuler::Swatch from a Nokogiri::XML::Element
8 9 10 11 |
# File 'lib/kuler/swatch.rb', line 8 def initialize( input ) hex = input.at( "./kuler:swatchHexColor" ).text @hex_code = "##{hex.downcase}" end |
Instance Attribute Details
#hex_code ⇒ Object
the hex code of the color swatch
5 6 7 |
# File 'lib/kuler/swatch.rb', line 5 def hex_code @hex_code end |