Skip to content
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

custom formatter option #2

Closed
wants to merge 1 commit into from
Closed

Conversation

TMaYaD
Copy link

@TMaYaD TMaYaD commented Nov 1, 2011

Added custom formatter option so that users can use it along with custom classes

@mustmodify
Copy link
Owner

Thank you for submitting this patch. It's a feature I've wanted in the
past, but could never come with with the right key. I'm still not wild
about formatter, but I agree something needs to be done about it. I've sent
out an email to some friends to see if they have any other suggestions. If
not, we'll go with what you have.

Again, thanks for the patch, and I hope the gem is as useful for you as it
has been for me.

jw

ps the other thing I was thinking about would be

has_value :date, :parse_with => 'Date.parse'
or
has_value :date, :parse_with => lambda {|atts| Date.parse(atts[:date])}


Johnathon Wright
Web Application Consultant

wave: jw@mustmodify.com
gtalk: jw@mustmodify.com
skype: johnathonwright
yahoo: johnathonewright
cell: 337 326 3121

http://www.mustmodify.com/

On Tue, Nov 1, 2011 at 4:36 AM, TMaYaD <
reply@reply.github.com>wrote:

Added custom formatter option so that users can use it along with custom
classes

You can merge this Pull Request by running:

git pull https://github.com/LoonyBin/valuable master

Or you can view, comment on it, or merge it online at:

#2

-- Commit Summary --

  • added custom formatter option to has_value

-- File Changes --

M lib/valuable/utils.rb (4)
M test/typical_test.rb (10)

-- Patch Links --

https://github.com/mustmodify/valuable/pull/2.patch
https://github.com/mustmodify/valuable/pull/2.diff

Reply to this email directly or view it on GitHub:
#2

@TMaYaD
Copy link
Author

TMaYaD commented Nov 5, 2011

parse_with definitely sounds better if lambda's are also allowed. It should be a trivial change to do it like active record. I'll get around to it some time.

@mustmodify mustmodify closed this Feb 24, 2012
@mustmodify
Copy link
Owner

I find myself needing this on a current project, so I'm moving forward with it. I've put down some ideas about how it should work. I'm interested in your thoughts.

http://blog.mustmodify.com/pages/valuable-ruby-gem-parse-with-notes

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.

None yet

2 participants