Class: BaremetricsAPI::Endpoint::Goals

Inherits:
Object
  • Object
show all
Defined in:
lib/baremetrics_api/endpoint/goals.rb

Constant Summary collapse

PATH =
'goals'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Goals

Returns a new instance of Goals.



6
7
8
# File 'lib/baremetrics_api/endpoint/goals.rb', line 6

def initialize(client)
  @client = client
end

Instance Method Details

#create_goal(goal_params:) ⇒ Object



18
19
20
# File 'lib/baremetrics_api/endpoint/goals.rb', line 18

def create_goal(goal_params:)
  JSON.parse(create_goal_request(goal_params).body).with_indifferent_access
end

#delete_goal(id:) ⇒ Object



22
23
24
# File 'lib/baremetrics_api/endpoint/goals.rb', line 22

def delete_goal(id:)
  JSON.parse(delete_goal_request(id).body).with_indifferent_access
end

#list_goals(page: nil) ⇒ Object



10
11
12
# File 'lib/baremetrics_api/endpoint/goals.rb', line 10

def list_goals(page: nil)
  JSON.parse(list_goals_request(page).body).with_indifferent_access
end

#show_goal(id:) ⇒ Object



14
15
16
# File 'lib/baremetrics_api/endpoint/goals.rb', line 14

def show_goal(id:)
  JSON.parse(show_goal_request(id).body).with_indifferent_access
end