Hiccdown Development Notes

Showing only those parts of the discussion which lead to #326.

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
Dennis HackethalOP revised 12 days ago·#1982
Show idea #330Show idea #3253rd of 3 versions leading to #326 (5 total)

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

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:

display = @display_module.new

view_context.instance_variables.each do |iv|
  display.instance_variable_set(
    iv,
    view_context.instance_variable_get(iv)
  )
end

Then:

class ProductsDisplay
  def index vc, # …
    vc.some_helper_method(@products)
  end
end
CriticismCriticized1oustanding criticism
Dennis Hackethal’s avatar
Dennis HackethalOP, about 1 year ago·#326

I’m trying this now. Having to prepend every invocation of a helper method with vc. is getting really old really fast.

Criticism of #1982