Closed smathy closed 8 years ago
The same should work with the cell
helper. Otherwise we have a inconsistent API.
Happy to add it, but let me explain my thoughts first and see if they change your thinking.
First that there's already a difference in the APIs between cell
and concept
. Also concept
already has the newer, less magical API so making it even less magical by allowing the actual class constant seemed much more fitting for concept
than cell
. Further to that cell
's magical API of adding the "_cell"
suffix would mean that cell "foo/bar"
would have to become cell Foo::BarCell
which is internally inconsistent for cell
's own API.
I understand what you mean, the reflection from the string argument to the class is different. But if we change only concept
we have a different API between both. Until now they have both the same args.
Sure there is a difference in the name notation, but I think thats the best way.
cell("foo/bar") == cell(Foo::BarCell)
concept("foo/bar") == concept(Foo::Bar)
Ok, so I refactored slightly to take out the duplicate code in both classes, so only the full_cell_name
method is implemented in both classes, the camelize.constantize
is only in the base class. I also renamed the name
parameter to name_or_class
where appropriate.
it look's like your are loving the close / open button :wink:
good work :+1:
Yeah, close/open is the only way I can trigger a new Travis run for those occasional failures. Using that @response.body.must_equal
is a bad idea without a describe
context. I'll send a PR to fix that too :)
Ok, so fixed that test failure in #338, could merge that to master and rebase this to get past those annoying travis false negatives.
:shipit: baby! Do you merge stuff @timoschilling - or is that only @apotonick ?
No thats only @apotonick, I'm only a normal user in this repo
:+1:
Bump, how about this @apotonick ?
Why so complicated?
Thanks for that, @smathy ! :heart:
Did I miss some simpler way to do that?
= concept "foo/bar"
can be:= concept Foo::Bar
and also= cell "foo/bar"
can be:= cell Foo::BarCell