module Gorillapi

Constants

VERSION

Public Instance Methods

header(header_name: '', api_key: '', format: 'json', version: 1) click to toggle source
# File lib/gorillapi.rb, line 17
def header(header_name: '', api_key: '', format: 'json', version: 1)
  self.class_eval("def content_type;'application/#{format}';end")
  self.class_eval("def format;'#{format}';end")
  self.class_eval("def version;'#{version}';end")
  self.class_eval("def token;'#{api_key}';end")
  self.class_eval("def accept_header; 'application/vnd.#{header_name}-v#{version}+#{format}'; end")
end
test_api(url: '') click to toggle source
# File lib/gorillapi.rb, line 13
def test_api(url: '')
  self.class_eval("def url;'#{url}';end")
end