Module: Fleetly::Activity

Included in:
Client
Defined in:
lib/fleetly/activity.rb

Instance Method Summary collapse

Instance Method Details

#get_activities(options = {}) ⇒ Hashie::Mash

Retrieve Activities

Parameters:

  • :name (String)

    Name to match

  • :type (String)

    Type of Activity

  • :start (Integer)

    Desired starting point

  • :limit (Integer)

    Maximum number of result

  • :order (String)

    Order of result

Returns:

  • (Hashie::Mash)

    Activity



30
31
32
33
34
35
36
# File 'lib/fleetly/activity.rb', line 30

def get_activities(options={})
  options = {}
  options[:oauth_token] = token
  activity_response = get("/api/v1/activities/search", options)

  activity_response if activity_response.result?
end

#get_activity(id) ⇒ Hashie::Mash

Retrieve Activity details given the ID

Parameters:

  • :id (String)

    Activity ID

Returns:

  • (Hashie::Mash)

    Activity



12
13
14
15
16
17
18
# File 'lib/fleetly/activity.rb', line 12

def get_activity(id)
  options = {}
  options[:oauth_token] = token
  activity_response = get("/api/v1/activities/#{id}", options)

  activity_response if activity_response.result?
end