class HaveAPI::Fs::Components::HelpFile

Public Class Methods

new(component, format) click to toggle source
Calls superclass method HaveAPI::Fs::Component::new
# File lib/haveapi/fs/components/help_file.rb, line 5
def initialize(component, format)
  super()
  @component = @c = component
  @context = component.context
  @format = format
end

Protected Instance Methods

layout(layout_erb) { || ... } click to toggle source
# File lib/haveapi/fs/components/help_file.rb, line 24
def layout(layout_erb)
  layout_erb.result(binding { yield })
end
template_path(klass) click to toggle source
# File lib/haveapi/fs/components/help_file.rb, line 13
def template_path(klass)
  if klass.is_a?(::String)
    name = klass
    
  else
    name = klass.help_file ? klass.help_file.to_s : klass.name.split('::').last.underscore
  end

  HaveAPI::Fs::Help.find!(::File.join(@format.to_s, name + ".erb"))
end