supercast 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/supercast.rb +1 -0
- data/lib/supercast/data_types.rb +2 -1
- data/lib/supercast/operations/feeds.rb +82 -0
- data/lib/supercast/resources.rb +1 -0
- data/lib/supercast/resources/feeds.rb +9 -0
- data/lib/supercast/version.rb +1 -1
- data/spec/lib/supercast/data_types_spec.rb +1 -0
- metadata +4 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 25cab022899835f7273b4926c69ed6cd9001e33971c01b117cc0f2072b326ac6
         | 
| 4 | 
            +
              data.tar.gz: ad3076662d959636b151f999a17c40117c42cbd531a067f4e716eb53566ad09c
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 82c86bbdd85ee90087d878ab158f4465286d5447d342d333c2f446a769d9a43b353b69c329d3abde7ddbbec882d628b6a3ae5b17d06038868391e15386288f0c
         | 
| 7 | 
            +
              data.tar.gz: 84fe673399d1c5b5f82810407b7bf2c7a196303c6cec5cfd3c9b5632cb99dd51d6041f48cc5a495b93b3da095416b9e2fb3bc62526c5e1c03a6cf79c83e3b138
         | 
    
        data/lib/supercast.rb
    CHANGED
    
    | @@ -21,6 +21,7 @@ require_relative 'supercast/operations/destroy' | |
| 21 21 | 
             
            require_relative 'supercast/operations/list'
         | 
| 22 22 | 
             
            require_relative 'supercast/operations/request'
         | 
| 23 23 | 
             
            require_relative 'supercast/operations/save'
         | 
| 24 | 
            +
            require_relative 'supercast/operations/feeds'
         | 
| 24 25 |  | 
| 25 26 | 
             
            # API resource support classes
         | 
| 26 27 | 
             
            require_relative 'supercast/errors'
         | 
    
        data/lib/supercast/data_types.rb
    CHANGED
    
    
| @@ -0,0 +1,82 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Supercast
         | 
| 4 | 
            +
              module Operations
         | 
| 5 | 
            +
                module Feeds
         | 
| 6 | 
            +
                  module ClassMethods
         | 
| 7 | 
            +
                    # Enables the feeds of the identified resource with the passed in parameters.
         | 
| 8 | 
            +
                    #
         | 
| 9 | 
            +
                    # ==== Attributes
         | 
| 10 | 
            +
                    #
         | 
| 11 | 
            +
                    # * +id+ - ID of the resource to activate the feeds for.
         | 
| 12 | 
            +
                    # * +opts+ - A Hash of additional options to be added to the request.
         | 
| 13 | 
            +
                    def activate(id, opts = {})
         | 
| 14 | 
            +
                      params = { feed_token: { state: 'active' } }
         | 
| 15 | 
            +
                      request(:patch, "#{resource_url}/#{id}", params, opts)
         | 
| 16 | 
            +
                      true
         | 
| 17 | 
            +
                    end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                    # Suspends the feeds of the identified resource with the passed in parameters.
         | 
| 20 | 
            +
                    #
         | 
| 21 | 
            +
                    # ==== Attributes
         | 
| 22 | 
            +
                    #
         | 
| 23 | 
            +
                    # * +id+ - ID of the resource to suspend the feeds for.
         | 
| 24 | 
            +
                    # * +opts+ - A Hash of additional options to be added to the request.
         | 
| 25 | 
            +
                    def suspend(id, opts = {})
         | 
| 26 | 
            +
                      params = { feed_token: { state: 'suspended' } }
         | 
| 27 | 
            +
                      request(:patch, "#{resource_url}/#{id}", params, opts)
         | 
| 28 | 
            +
                      true
         | 
| 29 | 
            +
                    end
         | 
| 30 | 
            +
             | 
| 31 | 
            +
                    # Deactivate the feeds of the identified resource with the passed in parameters.
         | 
| 32 | 
            +
                    #
         | 
| 33 | 
            +
                    # ==== Attributes
         | 
| 34 | 
            +
                    #
         | 
| 35 | 
            +
                    # * +id+ - ID of the resource to deactivate the feeds for.
         | 
| 36 | 
            +
                    # * +opts+ - A Hash of additional options to be added to the request.
         | 
| 37 | 
            +
                    def deactivate(id, opts = {})
         | 
| 38 | 
            +
                      params = { feed_token: { state: 'inactive' } }
         | 
| 39 | 
            +
                      request(:patch, "#{resource_url}/#{id}", params, opts)
         | 
| 40 | 
            +
                      true
         | 
| 41 | 
            +
                    end
         | 
| 42 | 
            +
                  end
         | 
| 43 | 
            +
             | 
| 44 | 
            +
                  # Enables the feeds of the current resource.
         | 
| 45 | 
            +
                  #
         | 
| 46 | 
            +
                  # ==== Attributes
         | 
| 47 | 
            +
                  #
         | 
| 48 | 
            +
                  # * +opts+ - A Hash of additional options to be added to the request.
         | 
| 49 | 
            +
                  def activate(opts = {})
         | 
| 50 | 
            +
                    params = { feed_token: { state: 'active' } }
         | 
| 51 | 
            +
                    request(:patch, resource_url, params, opts)
         | 
| 52 | 
            +
                    true
         | 
| 53 | 
            +
                  end
         | 
| 54 | 
            +
             | 
| 55 | 
            +
                  # Suspends the feeds of the current resource.
         | 
| 56 | 
            +
                  #
         | 
| 57 | 
            +
                  # ==== Attributes
         | 
| 58 | 
            +
                  #
         | 
| 59 | 
            +
                  # * +opts+ - A Hash of additional options to be added to the request.
         | 
| 60 | 
            +
                  def suspend(opts = {})
         | 
| 61 | 
            +
                    params = { feed_token: { state: 'suspended' } }
         | 
| 62 | 
            +
                    request(:patch, resource_url, params, opts)
         | 
| 63 | 
            +
                    true
         | 
| 64 | 
            +
                  end
         | 
| 65 | 
            +
             | 
| 66 | 
            +
                  # Deactivate the feeds of the current resource.
         | 
| 67 | 
            +
                  #
         | 
| 68 | 
            +
                  # ==== Attributes
         | 
| 69 | 
            +
                  #
         | 
| 70 | 
            +
                  # * +opts+ - A Hash of additional options to be added to the request.
         | 
| 71 | 
            +
                  def deactivate(opts = {})
         | 
| 72 | 
            +
                    params = { feed_token: { state: 'inactive' } }
         | 
| 73 | 
            +
                    request(:patch, resource_url, params, opts)
         | 
| 74 | 
            +
                    true
         | 
| 75 | 
            +
                  end
         | 
| 76 | 
            +
             | 
| 77 | 
            +
                  def self.included(base)
         | 
| 78 | 
            +
                    base.extend(ClassMethods)
         | 
| 79 | 
            +
                  end
         | 
| 80 | 
            +
                end
         | 
| 81 | 
            +
              end
         | 
| 82 | 
            +
            end
         | 
    
        data/lib/supercast/resources.rb
    CHANGED
    
    
    
        data/lib/supercast/version.rb
    CHANGED
    
    
| @@ -15,6 +15,7 @@ RSpec.describe Supercast::DataTypes do | |
| 15 15 | 
             
                  expect(list['role']).to eq(Supercast::Role)
         | 
| 16 16 | 
             
                  expect(list['subscriber']).to eq(Supercast::Subscriber)
         | 
| 17 17 | 
             
                  expect(list['usage_alert']).to eq(Supercast::UsageAlert)
         | 
| 18 | 
            +
                  expect(list['feed']).to eq(Supercast::Feeds)
         | 
| 18 19 | 
             
                end
         | 
| 19 20 | 
             
              end
         | 
| 20 21 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: supercast
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Jordan Ell
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2020-02-21 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: faraday
         | 
| @@ -96,6 +96,7 @@ files: | |
| 96 96 | 
             
            - lib/supercast/errors.rb
         | 
| 97 97 | 
             
            - lib/supercast/operations/create.rb
         | 
| 98 98 | 
             
            - lib/supercast/operations/destroy.rb
         | 
| 99 | 
            +
            - lib/supercast/operations/feeds.rb
         | 
| 99 100 | 
             
            - lib/supercast/operations/list.rb
         | 
| 100 101 | 
             
            - lib/supercast/operations/request.rb
         | 
| 101 102 | 
             
            - lib/supercast/operations/save.rb
         | 
| @@ -104,6 +105,7 @@ files: | |
| 104 105 | 
             
            - lib/supercast/resources/channel.rb
         | 
| 105 106 | 
             
            - lib/supercast/resources/creator.rb
         | 
| 106 107 | 
             
            - lib/supercast/resources/episode.rb
         | 
| 108 | 
            +
            - lib/supercast/resources/feeds.rb
         | 
| 107 109 | 
             
            - lib/supercast/resources/invite.rb
         | 
| 108 110 | 
             
            - lib/supercast/resources/role.rb
         | 
| 109 111 | 
             
            - lib/supercast/resources/subscriber.rb
         |