Class: Waxy::Meta
- Inherits:
-
Object
- Object
- Waxy::Meta
- Defined in:
- lib/waxy/meta.rb
Overview
Instances of Meta contain attributes that describe the visual appearance of a single hexagon.
Instance Attribute Summary collapse
-
#colors ⇒ Array
6 strings with SVG color= values.
-
#fill ⇒ Object
Hex fill not applicable to all templates.
-
#link ⇒ Object
a URL for the whole hexagon not applicable to all templates.
-
#link_title ⇒ Object
title value for hex <a>.
-
#pie_links ⇒ Object
An Array (0..5) of links, one for each slice of ‘Pie’.
-
#size ⇒ Object
Array of 6 * (0.0..1.0) scales “pie” slices.
-
#stroke ⇒ Object
Hex border SVG stroke.
Instance Method Summary collapse
- #hex_link_end ⇒ Object
-
#hex_link_start ⇒ Object
Helper methods.
- #hex_link_title ⇒ Object
-
#sum_size ⇒ Object
Describes how “full” a pie hexagon is.
Instance Attribute Details
#colors ⇒ Array
Returns 6 strings with SVG color= values.
33 34 35 |
# File 'lib/waxy/meta.rb', line 33 def colors @colors end |
#fill ⇒ Object
Hex fill not applicable to all templates
14 15 16 |
# File 'lib/waxy/meta.rb', line 14 def fill @fill end |
#link ⇒ Object
a URL for the whole hexagon not applicable to all templates
18 19 20 |
# File 'lib/waxy/meta.rb', line 18 def link @link end |
#link_title ⇒ Object
title value for hex <a>
21 22 23 |
# File 'lib/waxy/meta.rb', line 21 def link_title @link_title end |
#pie_links ⇒ Object
An Array (0..5) of links, one for each slice of ‘Pie’
30 31 32 |
# File 'lib/waxy/meta.rb', line 30 def pie_links @pie_links end |
#size ⇒ Object
Array of 6 * (0.0..1.0)
scales "pie" slices
27 28 29 |
# File 'lib/waxy/meta.rb', line 27 def size @size end |
#stroke ⇒ Object
Hex border SVG stroke
10 11 12 |
# File 'lib/waxy/meta.rb', line 10 def stroke @stroke end |
Instance Method Details
#hex_link_end ⇒ Object
66 67 68 |
# File 'lib/waxy/meta.rb', line 66 def hex_link_end '</a>' if link end |
#hex_link_start ⇒ Object
Helper methods
52 53 54 55 56 57 58 59 |
# File 'lib/waxy/meta.rb', line 52 def hex_link_start return nil unless link [ '<a href="' + link + '"', 'class="waxy__link"', '>' ].compact.join(' ') end |
#hex_link_title ⇒ Object
61 62 63 64 |
# File 'lib/waxy/meta.rb', line 61 def hex_link_title return nil unless link_title "<title>#{link_title}</title>" end |
#sum_size ⇒ Object
Describes how “full” a pie hexagon is
46 47 48 |
# File 'lib/waxy/meta.rb', line 46 def sum_size size.sum end |