Skip to content

Commit

Permalink
fix: add missing returned attribute for some summary models (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
duffn committed Mar 12, 2023
1 parent ab12e30 commit 2339e9c
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/harkness/models/character_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ module Harkness
# The summary of a character.
class CharacterSummary < Harkness::Base::Summary
# @!attribute [r] role
# @return [String] the role of the creator in the parent entity.
# @return [String] the role of the character in the parent entity.
attribute :role, Shale::Type::String
end

# A list of characters.
class CharacterList < Shale::Mapper
# @!attribute [r] available
# @return [Integer] the number of total available characters in this list.
# Will always be greater than or equal to the "returned" value.
# @return [Integer] the number of total available characters in this list.
# Will always be greater than or equal to the "returned" value.
attribute :available, Shale::Type::Integer
# @!attribute [r] returned
# @return [Integer] the number of characters returned in this collection (up to 20).
# @return [Integer] the number of characters returned in this collection (up to 20).
attribute :returned, Shale::Type::Integer
# @!attribute [r] collectionURI
# @return [String] the path to the full list of characters in this collection.
# @return [String] the path to the full list of characters in this collection.
attribute :collectionURI, Shale::Type::String
# @!attribute [r] offset
# @return [Array<Harkness::CharacterSummary>] the list of returned characters in this collection.
# @!attribute [r] items
# @return [Array<Harkness::CharacterSummary>] the list of returned characters in this collection.
attribute :items, Harkness::CharacterSummary, collection: true
end
end
3 changes: 3 additions & 0 deletions lib/harkness/models/comic_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class ComicList < Shale::Mapper
# @return [Integer] the number of total available issues in this list. Will always be greater than
# or equal to the "returned" value.
attribute :available, Shale::Type::Integer
# @!attribute [r] returned
# @return [Integer] the number of comics returned in this collection (up to 20).
attribute :returned, Shale::Type::Integer
# @!attribute [r] collectionURI
# @return [String] the path to the full list of issues in this collection.
attribute :collectionURI, Shale::Type::String
Expand Down
13 changes: 13 additions & 0 deletions lib/harkness/models/creator_list.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
# frozen_string_literal: true

module Harkness
# The summary of a creator.
class CreatorSummary < Harkness::Base::Summary
# @!attribute [r] role
# @return [String] the role of the creator in the parent entity.
attribute :role, Shale::Type::String
end

# A list of creators.
class CreatorList < Shale::Mapper
# @!attribute [r] available
# @return [Integer] the number of total available creators in this list.
# Will always be greater than or equal to the "returned" value.
attribute :available, Shale::Type::Integer
# @!attribute [r] returned
# @return [Integer] the number of creators returned in this collection (up to 20).
attribute :returned, Shale::Type::Integer
# @!attribute [r] collectionURI
# @return [String] the path to the full list of creators in this collection.
attribute :collectionURI, Shale::Type::String
# @!attribute [r] offset
# @return [Array<Harkness::CreatorySummary>] the list of returned creators in this collection.
attribute :items, Harkness::CreatorSummary, collection: true
end
end
10 changes: 10 additions & 0 deletions lib/harkness/models/event_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@ class EventSummary < Harkness::Base::Summary
end

class EventList < Shale::Mapper
# @!attribute [r] available
# @return [Integer] the number of total available events in this list.
# Will always be greater than or equal to the "returned" value.
attribute :available, Shale::Type::Integer
# @!attribute [r] returned
# @return [Integer] the number of events returned in this collection (up to 20).
attribute :returned, Shale::Type::Integer
# @!attribute [r] collectionURI
# @return [String] the path to the full list of events in this collection.
attribute :collectionURI, Shale::Type::String
# @!attribute [r] items
# @return [Array<Harkness::EventSummary>] the list of returned characters in this collection.
attribute :items, Harkness::EventSummary, collection: true
end
end
12 changes: 12 additions & 0 deletions lib/harkness/models/series_list.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
# frozen_string_literal: true

module Harkness
# The summary of a series.
class SeriesSummary < Harkness::Base::Summary
end

# A list of series.
class SeriesList < Shale::Mapper
# @!attribute [r] available
# @return [Integer] the number of total available series in this list.
# Will always be greater than or equal to the "returned" value.
attribute :available, Shale::Type::Integer
# @!attribute [r] returned
# @return [Integer] the number of series returned in this collection (up to 20).
attribute :returned, Shale::Type::Integer
# @!attribute [r] collectionURI
# @return [String] the path to the full list of series in this collection.
attribute :collectionURI, Shale::Type::String
# @!attribute [r] items
# @return [Array<Harkness::SeriesSummary>] the list of returned characters in this collection.
attribute :items, Harkness::SeriesSummary, collection: true
end
end
14 changes: 14 additions & 0 deletions lib/harkness/models/story_list.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
# frozen_string_literal: true

module Harkness
# The summary of a story.
class StorySummary < Harkness::Base::Summary
# @!attribute [r] type
# @return [String] the type of the story (interior or cover)
attribute :type, Shale::Type::String
end

# A list of stories.
class StoryList < Shale::Mapper
# @!attribute [r] available
# @return [Integer] the number of total available stories in this list.
# Will always be greater than or equal to the "returned" value.
attribute :available, Shale::Type::Integer
# @!attribute [r] returned
# @return [Integer] the number of stories returned in this collection (up to 20).
attribute :returned, Shale::Type::Integer
# @!attribute [r] collectionURI
# @return [String] the path to the full list of stories in this collection.
attribute :collectionURI, Shale::Type::String
# @!attribute [r] items
# @return [Array<Harkness::StorySummary>] the list of returned characters in this collection.
attribute :items, Harkness::StorySummary, collection: true
end
end

0 comments on commit 2339e9c

Please sign in to comment.