Sha256: 2a1126b80a9b352825fccd017513c0f2d26ca9e063854f54ffdf4da139d406c3

Contents?: true

Size: 676 Bytes

Versions: 4

Compression:

Stored size: 676 Bytes

Contents

module Centaman
  class Service::Package < 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::Package
    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

4 entries across 4 versions & 1 rubygems

Version Path
centaman-1.0.0 lib/centaman/service/package.rb
centaman-0.2.3 lib/centaman/service/package.rb
centaman-0.2.2 lib/centaman/service/package.rb
centaman-0.2.1 lib/centaman/service/package.rb