Sha256: 506f186415d697b20527b5bd49f15828c7f7015634d045b61a7f74b68534bd68

Contents?: true

Size: 503 Bytes

Versions: 2

Compression:

Stored size: 503 Bytes

Contents

require_relative 'folder'

class MoreappAPI
  class Customer

    attr_accessor :id, :name, :raw_data, :moreapp_api

    def initialize(moreapp_api, data)
      @moreapp_api = moreapp_api
      @id = data["customerId"]
      @name = data["name"]

      @raw_data = data
    end

    def folders
      response = @moreapp_api.request(:get, "/api/v1.0/customers/#{self.id}/folders")

      folders = JSON.parse(response.body)
      folders.map{|data| MoreappAPI::Folder.new(self, data)}
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
moreapp-api-0.0.2 lib/moreapp_api/customer.rb
moreapp-api-0.0.1 lib/moreapp_api/customer.rb