Skip to content

Instantly share code, notes, and snippets.

@jordanhudgens
Created April 17, 2018 04:25
Show Gist options
  • Save jordanhudgens/9af5089e9f138d256c9035a2ee5f7414 to your computer and use it in GitHub Desktop.
Save jordanhudgens/9af5089e9f138d256c9035a2ee5f7414 to your computer and use it in GitHub Desktop.
module GuidesHelper
def breadcrumb(topic:, title:)
"#{topic} / #{title}"
end
end
def breadcrumb(topic:, title:)
"oops"
end
class Guide
include GuidesHelper
def initialize(topic:, title:, content:)
@topic = topic
@title = title
@content = content
end
def page_render
puts breadcrumb(topic: @topic, title: @title)
puts @content
end
end
g = Guide.new(topic: 'Rails', title: 'My Cool Title', content: 'Some content')
g.page_render
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment