Skip to content

Add background color accessor #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Add background color accessor #45

wants to merge 1 commit into from

Conversation

jarthod
Copy link

@jarthod jarthod commented Jan 26, 2015

I saw this on the js version and it seemed really usefull to me for fallback or styling other element.
I was sad to see it wasn't in the ruby version 😢 so here it is!

@jasonlong
Copy link
Owner

👍 Makes sense to me.

@maxmeyer @ttaylorr Is this safe to merge now or should we wait for the current structural changes?

@maxmeyer
Copy link
Contributor

No, it's not safe to merge. It interferes with #40 and #44. It would be best to integrate it with #44. But I like the idea. We should add that functionality. Something like. Furthermore the style of tests will change a lot if @ttaylorr goes with the style introduced in the latest commits of #40.

class Pattern
  attr_reader :color
end

@jarthod
Copy link
Author

jarthod commented Jan 26, 2015

If you're planning on merging #40 soon I'll happily rebase this with the new code style ;)

@jasonlong
Copy link
Owner

Ok, #40 is merged.

@maxmeyer
Copy link
Contributor

@jarthod Maybe you want to wait a bit. I'm going to refactor the generators and will add a Pattern-class. This could hold the value you're interested in.

@jarthod
Copy link
Author

jarthod commented Jan 26, 2015

Ok, I was currently looking at the rebase and saw that with the new code I can only easily get the "rgb()" value, which is enough for the usecase I see (fallback for browser) but if we can make this more generic it's even better ;)

BTW is there any reason for the private attr_reader thing ? is it convention ? it looks like instance variable would be fine to me.

@jarthod
Copy link
Author

jarthod commented Jan 26, 2015

I temporarily pushed my changes to the branch. Let me know when I shall rebase again ;)

@maxmeyer
Copy link
Contributor

BTW is there any reason for the private attr_reader thing ? is it convention ? it looks like instance variable would be fine to me.

This makes refactoring a lot of easier. You just need to change the method implementation instead of changing all places where you use the instance variable.

And as the attr*-thing should be not part of the public api of the object I marked them as private.

@jarthod
Copy link
Author

jarthod commented Jan 26, 2015

The point of the feature is to expose the color attribute ;) if you make it private is just won't work.
BTW I think you pushed back the un-rebased branch of my work (at least the spec and readme).
Maybe I should have to a regular merge, but I just wanted to keep the commits clean ;)

@maxmeyer
Copy link
Contributor

I think I will expose it in the newly created Pattern-class.

@jarthod
Copy link
Author

jarthod commented Jan 27, 2015

Ok, let me know if you need any help/review then ;)

@maxmeyer
Copy link
Contributor

I will do. 😄

@ttaylorr
Copy link
Contributor

Yeah, this needs to wait for @maxmeyer's changes, but after that, I'm 👍 with this.

@maxmeyer
Copy link
Contributor

@jarthod

Can you review the current version on master if the new api is helpful for you? See https://github.com/jasonlong/geo_pattern#inspection-of-pattern for a more detailed description on the new api.

Cheers

@maxmeyer
Copy link
Contributor

Are there any other features found on the js version which might be helpful for you as well in the ruby version?

@jarthod
Copy link
Author

jarthod commented Feb 14, 2015

This looks great 👍 It does more than the js version now.
This will be 1.4 I guess ?

@jarthod jarthod closed this Feb 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants