Sha256: 4ae9e155f2ee4477358e750194a3d5294d45c23961b527638260ecbd9cee7b1d

Contents?: true

Size: 673 Bytes

Versions: 32

Compression:

Stored size: 673 Bytes

Contents

module Centaman
  class Service::AddOn < Centaman::Service
    include Centaman::JsonWrapper

    attr_reader :membership_type_id

    def after_init(args)
      @membership_type_id = args.fetch(:membership_type_id, nil).try(:to_i)
    end

    def endpoint
      "/member_services/MembershipType?PackageID=#{membership_type_id}"
    end

    def object_class
      Centaman::Object::AddOn
    end

    def self.find(membership_type_id, id)
      obj = new(membership_type_id: membership_type_id)
      obj.objects.detect { |obj| obj.id == id }
    end

    def additional_hash_to_serialize_after_response
      { membership_type_id: membership_type_id }
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
centaman-8.0.0 lib/centaman/service/add_on.rb
centaman-7.0.5 lib/centaman/service/add_on.rb
centaman-7.0.4 lib/centaman/service/add_on.rb
centaman-7.0.3 lib/centaman/service/add_on.rb
centaman-7.0.2 lib/centaman/service/add_on.rb
centaman-7.0.1 lib/centaman/service/add_on.rb
centaman-7.0.0 lib/centaman/service/add_on.rb
centaman-6.0.8 lib/centaman/service/add_on.rb
centaman-6.0.7 lib/centaman/service/add_on.rb
centaman-6.0.5 lib/centaman/service/add_on.rb
centaman-6.0.4 lib/centaman/service/add_on.rb
centaman-6.0.3 lib/centaman/service/add_on.rb
centaman-6.0.2 lib/centaman/service/add_on.rb
centaman-6.0.1 lib/centaman/service/add_on.rb
centaman-6.0.0 lib/centaman/service/add_on.rb
centaman-5.0.8 lib/centaman/service/add_on.rb
centaman-5.0.7 lib/centaman/service/add_on.rb
centaman-5.0.6 lib/centaman/service/add_on.rb
centaman-5.0.5 lib/centaman/service/add_on.rb
centaman-5.0.4 lib/centaman/service/add_on.rb