Comparing #330 (Version 4) and #1982 (Version 5)

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

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
Marked as criticism
#1982·Dennis Hackethal·4 months ago·Criticism
3 comments: #314, #317, and #326