Sha256: ff4d2af0ad99757fa731c0ebadfffffb00efde398a542ca9e671123ae510866e
Contents?: true
Size: 947 Bytes
Versions: 29
Compression:
Stored size: 947 Bytes
Contents
module SlackRubyBotServer module Api module Presenters module RootPresenter include Roar::JSON::HAL include Roar::Hypermedia include Grape::Roar::Representer link :self do |opts| "#{base_url(opts)}/api" end link :status do |opts| "#{base_url(opts)}/api/status" end link :teams do |opts| { href: "#{base_url(opts)}/api/teams/#{link_params(Helpers::PaginationParameters::ALL, :active)}", templated: true } end link :team do |opts| { href: "#{base_url(opts)}/api/teams/{id}", templated: true } end private def base_url(opts) request = Grape::Request.new(opts[:env]) request.base_url end def link_params(*args) "{?#{args.join(',')}}" end end end end end
Version data entries
29 entries across 29 versions & 1 rubygems