class Navy::SectionParser

Attributes

sections[R]

Public Class Methods

new(context) click to toggle source
# File lib/navy/section_parser.rb, line 8
def initialize(context)
  @context = context
  @sections = []
end

Public Instance Methods

method_missing(method, *args, &block) click to toggle source
Calls superclass method
# File lib/navy/section_parser.rb, line 27
def method_missing(method, *args, &block)
  if @context.respond_to?(method, false)
    @context.send(method, *args, &block)
  else
    super
  end
end
parse(block_args, &block) click to toggle source
# File lib/navy/section_parser.rb, line 13
def parse(block_args, &block)
  instance_exec(*block_args, &block)
  self
end
respond_to?(method, include_private = false) click to toggle source
Calls superclass method
# File lib/navy/section_parser.rb, line 23
def respond_to?(method, include_private = false)
  super || @context.respond_to?(method, false) # don't forward private messages
end
section(name, label, url = nil, link_to_options = {}, &children) click to toggle source
# File lib/navy/section_parser.rb, line 18
def section(name, label, url = nil, link_to_options = {}, &children)
  section = Navy::Section.new(name, label, url, link_to_options, @context.section_active?(name), &children)
  sections << section
end