lib/mtg_sdk/changelog.rb in mtg_sdk-1.1.1 vs lib/mtg_sdk/changelog.rb in mtg_sdk-2.0.0

- old
+ new

@@ -1,28 +1,24 @@ require_relative 'representers/changelog_representer' -require_relative 'resource' module MTG - class Changelog < Resource + class Changelog include Roar::JSON - include RestClient include ChangelogRepresenter attr_accessor :version, :details, :release_date + # Get the resource string + # + # @return [string] The API resource string + def self.Resource + "changelogs" + end + # Get all changelogs # # @return [Array<Changelog>] Array of Changelog objects def self.all - changelogs = [] - response = RestClient.get('changelogs') - data = response.body['changelogs'] - - data.each do |changelog| - changelogs << new.extend(ChangelogRepresenter).from_json(changelog.to_json) - end - - @query = nil - changelogs + QueryBuilder.new(Changelog).all end end end