Skip to content

Commit

Permalink
Merge pull request #25 from parkr/patch-1
Browse files Browse the repository at this point in the history
Change Pattern::PATTERNS to a frozen array of Strings
  • Loading branch information
Jason Long committed Feb 21, 2014
2 parents ae3321c + 81cb854 commit fd3a83b
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions lib/geo_pattern/pattern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ class Pattern
:base_color => '#933c3c'
}

PATTERNS = [
:octogons,
:overlapping_circles,
:plus_signs,
:xes,
:sine_waves,
:hexagons,
:overlapping_rings,
:plaid,
:triangles,
:squares,
:concentric_circles,
:diamonds,
:tessellation,
:nested_squares,
:mosaic_squares,
:triangles_rotated,
:chevrons
]
PATTERNS = %w[
octogons
overlapping_circles
plus_signs
xes
sine_waves
hexagons
overlapping_rings
plaid
triangles
squares
concentric_circles
diamonds
tessellation
nested_squares
mosaic_squares
triangles_rotated
chevrons
].freeze

FILL_COLOR_DARK = "#222"
FILL_COLOR_LIGHT = "#ddd"
Expand Down Expand Up @@ -81,7 +81,7 @@ def generate_background

def generate_pattern
if opts[:generator]
if PATTERNS.include?(opts[:generator].to_sym)
if PATTERNS.include?(opts[:generator])
send("geo_#{opts[:generator]}")
else
abort("Error: the requested generator is invalid.")
Expand Down

0 comments on commit fd3a83b

Please sign in to comment.