module ApiSim::ViewHelpers

Public Instance Methods

config() click to toggle source
# File lib/api_sim/view_helpers.rb, line 15
def config
  @config
end
custom_matcher?(endpoint) click to toggle source
# File lib/api_sim/view_helpers.rb, line 7
def custom_matcher?(endpoint)
  endpoint.custom_matcher? ? '(Custom matcher)' : ''
end
endpoint_match(endpoint) click to toggle source
# File lib/api_sim/view_helpers.rb, line 41
def endpoint_match (endpoint)
  if endpoint.match_on_body? then
    "/#{endpoint.matcher.source}/"
  else
    ''
  end
end
endpoint_query_string(endpoint) click to toggle source
# File lib/api_sim/view_helpers.rb, line 11
def endpoint_query_string(endpoint)
  "?#{endpoint.query}" if endpoint.query != ''
end
endpoints() click to toggle source
# File lib/api_sim/view_helpers.rb, line 3
def endpoints
  self.class.endpoints.reject(&:overridden?).sort_by { |endpoint| [endpoint.http_method, endpoint.route].join(' ') }
end
h(text) click to toggle source
# File lib/api_sim/view_helpers.rb, line 28
def h(text)
  Rack::Utils.escape_html(text)
end
ui_root() click to toggle source
# File lib/api_sim/view_helpers.rb, line 49
def ui_root
  self.class.ui_root
end