Sha256: e85ab39c13452f4d57212a9baa8d782aca802c8e50e74ec1cc86aa40e987b677
Contents?: true
Size: 618 Bytes
Versions: 11
Compression:
Stored size: 618 Bytes
Contents
module AppleNews class Section include Resource include Links attr_reader :id, :type, :name, :is_default, :links, :created_at, :modified_at, :share_url def initialize(id, data = nil) @id = id @resource_path = "/sections" data.nil? ? hydrate! : set_read_only_properties(data) end def channel Channel.new(channel_link_id('channel')) end def articles(params = {}) request = Request::Get.new("/sections/#{id}/articles") resp = request.call(params) resp['data'].map do |article| Article.new(article['id']) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems