Sha256: a991aee9570bd2ac00200620544ed2bddab61d27a63cc8fd565b9e0600e8750e

Contents?: true

Size: 867 Bytes

Versions: 9

Compression:

Stored size: 867 Bytes

Contents

module Youroom
  class AddParticipation < Request
    attr_reader :billing_id, :billing_group_id, :email

    def initialize(access_token, billing_id, billing_group_id, email, url=BASE_URL)
      [billing_id, billing_group_id].each {|arg| required_structure(arg, String, Symbol, Fixnum)}
      required_structure(email, String)
      @billing_id, @billing_group_id, @email = billing_id.to_s, billing_group_id.to_s, email
      super(access_token, url)
    end

    def path
      if url == BASE_URL
        File.join(::Youroom::BASE_URL, 'billings', billing_id, 'billing_groups', billing_group_id, 'participations', 'add?format=json')
      else
        File.join(url, 'enterprise', 'billings', billing_id, 'billing_groups', billing_group_id, 'participations', 'add?format=json')
      end
    end

    def params
      { :email => email }.optimize
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
youroom_api-0.1.4 lib/youroom_api/request/add_participation.rb
youroom_api-0.1.3 lib/youroom_api/request/add_participation.rb
youroom_api-0.1.2 lib/youroom_api/request/add_participation.rb
youroom_api-0.1.1 lib/youroom_api/request/add_participation.rb
youroom_api-0.1.0 lib/youroom_api/request/add_participation.rb
youroom_api-0.0.13 lib/youroom_api/request/add_participation.rb
youroom_api-0.0.12 lib/youroom_api/request/add_participation.rb
youroom_api-0.0.11 lib/youroom_api/request/add_participation.rb
youroom_api-0.0.10 lib/youroom_api/request/add_participation.rb