lib/kentaa/api/resources/activity.rb in kentaa-api-0.7.2 vs lib/kentaa/api/resources/activity.rb in kentaa-api-0.8.0
- old
+ new
@@ -1,22 +1,38 @@
# frozen_string_literal: true
module Kentaa
module Api
module Resources
- class Activity
- attr_reader :data
+ class Activity < Resource
+ def object_key
+ "Activity_#{id}"
+ end
- def initialize(data)
- @data = data
+ def site
+ Kentaa::Api::Resources::Site.new(config, id: site_id, options: options)
end
- def id
- data[:id]
+ def site_id
+ data[:site_id]
end
def name
data[:name]
+ end
+
+ def sign_up_limit
+ data[:sign_up_limit]
+ end
+
+ def sign_up_count
+ data[:sign_up_count]
+ end
+
+ private
+
+ def load_resource
+ request.get("#{endpoint_path}/#{id}", options)
end
end
end
end
end