Class: PowerBiEmbedded::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/power_bi_embedded/base.rb

Class Method Summary collapse

Class Method Details

.delete(endpoint, headers = nil) ⇒ Object



23
24
25
26
# File 'lib/power_bi_embedded/base.rb', line 23

def self.delete(endpoint, headers = nil)
  response = HTTParty.delete(endpoint, headers: headers)
  parse_response(response)
end

.get(endpoint, query = nil, headers = nil) ⇒ Object



8
9
10
11
# File 'lib/power_bi_embedded/base.rb', line 8

def self.get(endpoint, query = nil, headers = nil)
  response = HTTParty.get(endpoint, headers: headers, query: query)
  parse_response(response)
end

.parse_response(response) ⇒ Object



28
29
30
# File 'lib/power_bi_embedded/base.rb', line 28

def self.parse_response(response)
  response.parsed_response.deep_symbolize_keys
end

.post(endpoint, body = nil, headers = nil) ⇒ Object



13
14
15
16
# File 'lib/power_bi_embedded/base.rb', line 13

def self.post(endpoint, body = nil, headers = nil)
  response = HTTParty.post(endpoint, headers: headers, body: body)
  parse_response(response)
end

.put(endpoint, body = nil, headers = nil) ⇒ Object



18
19
20
21
# File 'lib/power_bi_embedded/base.rb', line 18

def self.put(endpoint, body = nil, headers = nil)
  response = HTTParty.put(endpoint, headers: headers, body: body)
  parse_response(response)
end