Class: Houston::ColorValue

Inherits:
Object
  • Object
show all
Defined in:
lib/houston/boot/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, hex) ⇒ ColorValue

Returns a new instance of ColorValue.



423
424
425
426
# File 'lib/houston/boot/configuration.rb', line 423

def initialize(name, hex)
  @name = name
  @hex = hex
end

Instance Attribute Details

#hexObject (readonly)

Returns the value of attribute hex.



421
422
423
# File 'lib/houston/boot/configuration.rb', line 421

def hex
  @hex
end

#nameObject (readonly)

Returns the value of attribute name.



420
421
422
# File 'lib/houston/boot/configuration.rb', line 420

def name
  @name
end

Instance Method Details

#as_json(options = {}) ⇒ Object



428
429
430
# File 'lib/houston/boot/configuration.rb', line 428

def as_json(options={})
  name
end

#rgbObject



436
437
438
# File 'lib/houston/boot/configuration.rb', line 436

def rgb
  "rgb(#{@hex.scan(/../).map { |s| s.to_i(16) }.join(", ")})"
end

#to_sObject



432
433
434
# File 'lib/houston/boot/configuration.rb', line 432

def to_s
  name
end