Plain Old Ruby Objects with initializers taking arguments

28 views
Skip to first unread message

Sean DeNigris

unread,
Mar 6, 2010, 11:36:01 PM3/6/10
to Machinist Users
I can't figure out how to pass arguments to new. Any ideas?

Eg.
object file:
class RubyApplicationSkeletonCreator
def initialize(application_name)
...
end
...
end

blueprint:
RubyApplicationSkeletonCreator.blueprint do
end

use:
RubyApplicationSkeletonCreator.make('a_name') # with or without
argument

Output:
wrong number of arguments (0 for 1)

Thanks
Sean

Pete Yandell

unread,
Mar 8, 2010, 6:54:27 PM3/8/10
to machini...@googlegroups.com
On 7 March 2010 15:36, Sean DeNigris <trus...@clipperadams.com> wrote:
> I can't figure out how to pass arguments to new.  Any ideas?

There's no support for doing this in Machinist at the moment.

If you want to figure out how to add it, the place to start looking is
in lib/machinist/object.rb

- Pete

Sean DeNigris

unread,
Mar 8, 2010, 11:04:06 PM3/8/10
to Machinist Users
> There's no support for doing this in Machinist at the moment.
>
> If you want to figure out how to add it, the place to start looking is
> in lib/machinist/object.rb

Thanks! I added the functionality with passing specs at
http://github.com/lotusone/machinist.

- Sean

Reply all
Reply to author
Forward
0 new messages