Sha256: c630126dcb913af3fbae56f3e3c92f4323f1c52726952be18a87629f0a356a51

Contents?: true

Size: 546 Bytes

Versions: 9

Compression:

Stored size: 546 Bytes

Contents

module Youroom
  class AddRoom < Request
    attr_reader :name, :billing_id

    def initialize(access_token, billing_id, name, url=BASE_URL)
      required_structure(billing_id, String, Fixnum)
      required_structure(name, String, Symbol)
      @billing_id, @name = billing_id.to_s, name.to_s
      super(access_token, url)
    end

    def path
      File.join(url, 'billings', billing_id, 'billing_groups?format=json')
    end

    def params
      { :billing_group => { :group_attributes => { :name => name } } }.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_room.rb
youroom_api-0.1.3 lib/youroom_api/request/add_room.rb
youroom_api-0.1.2 lib/youroom_api/request/add_room.rb
youroom_api-0.1.1 lib/youroom_api/request/add_room.rb
youroom_api-0.1.0 lib/youroom_api/request/add_room.rb
youroom_api-0.0.13 lib/youroom_api/request/add_room.rb
youroom_api-0.0.12 lib/youroom_api/request/add_room.rb
youroom_api-0.0.11 lib/youroom_api/request/add_room.rb
youroom_api-0.0.10 lib/youroom_api/request/add_room.rb