Hiccdown Development Notes

Showing only those parts of the discussion that lead to #324.

See full discussion·See most recent related ideas
  Log in or sign up to participate in this discussion.
With an account, you can revise, criticize, and comment on ideas.

Discussions can branch out indefinitely. Zoom out for the bird’s-eye view.
Dennis Hackethal’s avatar
5th of 5 versions leading to #324 (5 total)

Hiccdown methods should live in their own, separate classes. How about they are called ‘displays’?

ruby
class ProductsDisplay
def index vc, # …
vc.some_helper_method
end
end

Behind the scenes, the Hiccdown gem would need to make the instance variables available to the display class:

ruby
display = @display_module.new
view_context.instance_variables.each do |iv|
display.instance_variable_set(
iv,
view_context.instance_variable_get(iv)
)
end

Then:

ruby
class ProductsDisplay
def index vc, # …
vc.some_helper_method(@products)
end
end
CriticismCriticized1*Archived
Dennis Hackethal’s avatar
2nd of 2 versions leading to #324 (2 total)

Then how would you call index from a helper method?

Criticism of #1982Criticized1*
Dennis Hackethal’s avatar

I don’t think that’s something people would do a lot, but they still easily could: ProductsRenderer.index(self)

Criticism of #317
Dennis Hackethal’s avatar

Test this!

Criticism of #315Criticized1*
Dennis Hackethal’s avatar
Only version leading to #324 (2 total)

Tested, it works.

Criticism of #321Criticized1*
Dennis Hackethal’s avatar

Superseded by #323. This comment was generated automatically.

Criticism of #322