Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

seanohalpin’s Activity (RSS)

Thursday, January 28 2016
12 Permit inline :must => was updated in doodle
  • kentnl@cpan.org
    kentnl@cpan.org commented at 5:48 AM

    Fwiw, I'm also poking at a few type constraint systems and hope its possible to have some kind of adapter class that allows using these type constraints under d...

Wednesday, January 27 2016
12 Permit inline :must => was created in doodle
  • kentnl@cpan.org
    kentnl@cpan.org created the ticket at 9:36 PM

    I initially thought perhaps I could get away with something like:

    
      require 'doodle'
    
      class TypeCheck
        def TypeCheck.fixed_length(length)
          ["be leng...
Wednesday, October 21 2009
9 Store defaults after first request was updated in doodle
  • Justin Ossevoort
    Justin Ossevoort commented at 1:45 PM

    My examples were pretty screwed up, here is a cleaned up version with example:

        require 'doodle'
    
        $counter = 0
    
        class Foo < Doodle
           has init_a...
10 Support for 'predicate' and 'clearer' methods was updated in doodle
  • Justin Ossevoort
    Justin Ossevoort commented at 1:34 PM

    oh and the first block should of course have read:

        f.has?(:simple_attr)       # => true
        f.valued?(:simple_attr)    # => false
        f.assigned?(:simple_a...
  • Justin Ossevoort
    Justin Ossevoort commented at 1:29 PM

    I've been mulling over this for some days, but for these cover the really essential introspection needs. The only possibly relevant one that's possibly missing ...

Thursday, October 15 2009
10 Support for 'predicate' and 'clearer' methods was updated in doodle
  • Sean O'Halpin
    Sean O'Halpin commented at 12:28 PM

    I like #has?

    obj.has?(name) would be syntactic sugar for
    obj.doodle.attributes.key?(name) where obj can be either a class or an
    instance.

    I'll include this in t...

Monday, October 12 2009
10 Support for 'predicate' and 'clearer' methods was updated in doodle
  • Justin Ossevoort
    • Tag set to feature
    by Justin Ossevoort at 8:49 AM
  • Justin Ossevoort
    Justin Ossevoort commented at 8:00 AM

    The clearer is great, that really complements the <.assigned?>

    I agree that the ActiveRecord way is ugly for it really conflicts with the way you'd expect boole...

9 Store defaults after first request was updated in doodle
  • Justin Ossevoort
    • Tag set to feature
    by Justin Ossevoort at 8:43 AM

    I see I didn't really state my intentions clearly. What I was looking for was something along the lines of lazy initialization. And neither nor really do that.

    ...

11 Support for 'readonly' attributes was updated in doodle
  • Justin Ossevoort
    Justin Ossevoort commented at 8:03 AM

    Ah I was wondering how to do that, I'm more used to traditional issue tracking systems which have a clear classification, but I can see how tags help to simulat...

Sunday, October 11 2009
7 update docs was updated in doodle
10 Support for 'predicate' and 'clearer' methods was updated in doodle
  • Sean O'Halpin
    • State changed from new to resolved
    by Sean O'Halpin at 2:53 AM

    As you have pointed out, #instance_variable_defined? and #remove_instance_variable do exactly what you want.

    However, using them does rely on the underlying imp...

11 Support for 'readonly' attributes was updated in doodle
  • Sean O'Halpin
    Sean O'Halpin commented at 2:37 AM

    Regarding your other points:

    By all means tag a ticket with "feature" to denote a feature request.

    I'd welcome any patches - no promises to incorporate them tho...

  • Sean O'Halpin
    • State changed from new to resolved
    by Sean O'Halpin at 2:34 AM

    Use the :readonly option (introduced in version 0.1.9):

    require 'doodle'
    
    class Foo < Doodle
      counter = 0
      has :uid, :readonly => true do
        init { counter ...
9 Store defaults after first request was updated in doodle
  • Sean O'Halpin
    • State changed from new to resolved
    by Sean O'Halpin at 2:29 AM

    Apologies for the long delay in replying.

    For your use case, I would use #init rather than #default. Something like this:

    require 'doodle'
    
    class Foo < Doodle
    ...
Tuesday, July 07 2009
9 Store defaults after first request was updated in doodle
  • Justin Ossevoort
    Justin Ossevoort commented at 1:14 PM

    Oh, and here is the way to currently work around this:

    class Foo < Doodle
      @@serial = 0
      has :uid do
         default{ @uid = @@serial += 1 }
      end
    end
    
    x = Foo....
Wednesday, June 24 2009
11 Support for 'readonly' attributes was created in doodle
  • Justin Ossevoort
    Justin Ossevoort created the ticket at 1:31 PM

    It would be nice if one could easily prevent the generation of the setter method. Perhaps something along the lines of Moose's 'is' property:

    has :uuid, :is =>...
Tuesday, June 23 2009
10 Support for 'predicate' and 'clearer' methods was created in doodle
  • Justin Ossevoort
    Justin Ossevoort created the ticket at 11:29 AM

    I used Moose under perl and there they used the concept of 'predicate' and 'clearer' methods (normally something like: has_X and clear_X). A predicate under rub...

9 Store defaults after first request was created in doodle
  • Justin Ossevoort
    Justin Ossevoort created the ticket at 9:47 AM

    Currently the default behaves like a "if no value is set, return the (result of) default". So requesting the same attribute,that has no value, multiple times wi...

Sunday, March 15 2009
5 rework collectors for 1.9 was updated in doodle
  • Sean O'Halpin
    • State changed from new to resolved
    by Sean O'Halpin at 6:00 PM
  • Sean O'Halpin
    Sean O'Halpin created the ticket at 5:56 PM

    don't use eval to define collectors in 1.9

6 'union' has was updated in doodle
  • Sean O'Halpin
    • Milestone set to Release 0.2.4
    • Tag changed from core, hash to core, has
    by Sean O'Halpin at 5:59 PM
  • Sean O'Halpin
    Sean O'Halpin created the ticket at 5:57 PM

    make it possible to define mutually exclusive attributes, i.e. either/or

8 visitor framework was created in doodle
  • Sean O'Halpin
    Sean O'Halpin created the ticket at 5:59 PM

    make it easy to define your own visitors

    and redo to_hash to use this (rather than current hack with to_yaml)

7 update docs was created in doodle
  • Sean O'Halpin
    Sean O'Halpin created the ticket at 5:58 PM

    update docs to - sort out examples (use better examples) - ensure that all core functionality is documented

4 explain factory/constructor functions was updated in doodle
  • Sean O'Halpin
    • State changed from new to resolved
    by Sean O'Halpin at 5:54 PM
  • Sean O'Halpin
    Sean O'Halpin commented at 5:54 PM

    Not needed anymore - works as expected with modules (e.g. can do Foo::Bar(args) as well as Foo.Bar(args)

Saturday, March 14 2009
4 explain factory/constructor functions was updated in doodle
  • Sean O'Halpin
    • Milestone changed from Release 0.2.4 to Release 0.2.3
    by Sean O'Halpin at 6:06 PM
  • Sean O'Halpin
    • Milestone changed from Release 0.2.3 to Release 0.2.4
    by Sean O'Halpin at 6:05 PM
Release 0.2.4 was created by Sean O'Halpin in doodle at 6:05 PM
&nbsp;
3 of 4 tickets remain in this milestone
2 support multiple types for collectors was updated in doodle
Monday, March 09 2009
1 add JSON support was updated in doodle
  • Sean O'Halpin
    • State changed from new to resolved
    by Sean O'Halpin at 11:30 PM
3 explain how to use defer_validation was updated in doodle
Release 0.2.3 was updated by Sean O'Halpin in doodle at 4:54 PM
&nbsp;
0 of 4 tickets remain in this milestone
Friday, March 06 2009
1 command line utility to manage tickets was updated in misc
  • Sean O'Halpin
    • Tag changed from tool, tracking to cli, tool, tracking
    by Sean O'Halpin at 1:42 AM

    perhaps integrate with ditz

  • Sean O'Halpin
    Sean O'Halpin created the ticket at 1:42 AM

    Command line tool to

    • add ticket
    • change ticket state
    • close ticket
    • list tickets
Home was created by Sean O'Halpin in misc at 1:40 AM
4 explain factory/constructor functions was created in doodle
  • Sean O'Halpin
    Sean O'Halpin created the ticket at 12:56 AM

    e.g. explain how to use in modules and limitations

3 explain how to use defer_validation was created in doodle
  • Sean O'Halpin
    Sean O'Halpin created the ticket at 12:53 AM

    document how to use defer_validation to change attributes, even when that leaves the doodle temporarily in an invalid state

2 support multiple types for collectors was created in doodle
  • Sean O'Halpin
    Sean O'Halpin created the ticket at 12:35 AM

    For example, I want to use something like:

    
      has :shapes, :collect => [Circle, Square]
    

    or

    
      has :shapes, :collect => {:circle => Circle, :square => Squar...
1 add JSON support was created in doodle
  • Sean O'Halpin
    Sean O'Halpin created the ticket at 12:03 AM

    Add Doodle.from_json for parsing JSON and doodle.to_json for output

Release 0.2.3 was updated by Sean O'Halpin in doodle at 12:02 AM 3 more events
&nbsp;
0 of 4 tickets remain in this milestone
Thursday, March 05 2009
Release 0.2.3 was created by Sean O'Halpin in doodle at 11:59 PM
&nbsp;
0 of 4 tickets remain in this milestone
Home was edited by Sean O'Halpin in doodle at 1:09 AM (+2 more edits)