Class: Fauve::Scheme::Section
- Inherits:
-
Object
- Object
- Fauve::Scheme::Section
- Defined in:
- lib/fauve/scheme/section.rb
Overview
Representation of a section key as part of a wider scheme. Holds a section name, which points to a top-level key within a colour scheme. Takes a section name (string)
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Section
constructor
A new instance of Section.
- #to_h ⇒ Object
Constructor Details
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/fauve/scheme/section.rb', line 11 def name @name end |
Instance Method Details
#to_h ⇒ Object
18 19 20 21 |
# File 'lib/fauve/scheme/section.rb', line 18 def to_h return colour_map.map[name] if section_exists? raise Fauve::UndefinedSectionError.new('Section is not referenced in config') end |