Closed maxmeyer closed 9 years ago
:+1: from me.
On Sun, Jan 25, 2015 at 2:02 AM, maxmeyer notifications@github.com wrote:
Looking here https://github.com/jasonlong/geo_pattern/blob/master/lib/geo_pattern.rb#L32 and here https://github.com/jasonlong/geo_pattern/blame/master/README.md#L37 it seems to be a little bit weird to speak of a pattern pattern = [...]. Furthermore we`ve now some problems to write good tests.
So I suggest to add a Pattern-class which also add some support for introspection like
pattern.pattern? XesPattern
=> true/false
pattern.background_color? '#0a0a0a'
=> true/false
pattern.color? '#0a0a0a'
=> true/false
It would also the responsibility of that class to output the pattern in the correct format (link https://github.com/jasonlong/geo_pattern/blob/master/lib/geo_pattern/pattern_generator.rb#L44 )
def to_svg svg.to_sendalias_method :to_s, :to_svgalias_method :svg_string, :to_svg def to_base64 Base64.strict_encode64(svg_string)endalias_method :base64_string, :to_base64 def to_data_uri "url(data:image/svg+xml;base64,#{base64_string});"endalias_method :uri_image, :to_data_uri
@jasonlong https://github.com/jasonlong @ttaylorr https://github.com/ttaylorr What do you think?
— Reply to this email directly or view it on GitHub https://github.com/jasonlong/geo_pattern/issues/44.
Thanks, Taylor Blau
ttaylorr.com
Seems ok to me. If I understand right, the syntax for the end user would remain the same?
Yes. I would just add some deprecation warnings for the "old" api.
Should I open a new PR or should I add this functinality in #40?
I would prefer to open a new one as #40 contains quite a lot changes already.
Fixed by #46
Looking here and here it seems to be a little bit weird to speak of a pattern
pattern = [...]
. Furthermore we`ve now some problems to write good tests.So I suggest to add a
Pattern
-class which also add some support for introspection likeThis class would be generated by the
PatternGenerator
.It would also the responsibility of that class to output the pattern in the correct format (link)
@jasonlong @ttaylorr What do you think?