class Opalla::Util::JsFormatter

Public Class Methods

new() click to toggle source
# File lib/opalla/util.rb, line 13
def initialize
  @buffer = []
end

Public Instance Methods

header(routes) click to toggle source
# File lib/opalla/util.rb, line 32
def header(routes); end
result() click to toggle source
# File lib/opalla/util.rb, line 17
def result
  @buffer
end
section(routes) click to toggle source
# File lib/opalla/util.rb, line 21
def section(routes)
  @buffer = routes.each_with_object({}) do |r, memo|
    path = r[:path].gsub(/\(.:format\)/, '')
    memo[r[:name]] = {
      verb: r[:verb],
      path: path,
      reqs: r[:reqs]
    }
  end
end