Sha256: 2250cc363cfccc2fdaad7583915f7a74d242eb48e4033aa555b856e2e0a46932

Contents?: true

Size: 875 Bytes

Versions: 15

Compression:

Stored size: 875 Bytes

Contents

module Vzaar
  module Resource
    class User < Base
      root_node "//user"

      attribute :created_at, type: Time
      attribute :max_file_size, type: Integer
      attribute :account_type_id, field: :author_account, type: Integer
      attribute :account_type_name, field: :author_account_title
      attribute :name, field: :author_name
      attribute :url, field: :author_url
      attribute :id, field: :author_id, type: Integer
      attribute :video_count, type: Integer
      attribute :play_count, type: Integer
      attribute :videos_total_size, type: Integer
      attribute :bandwidth_this_month, type: Integer

      def bandwidth
        @bandwidth ||= doc.xpath("//bandwidth/period").map do |e|
          attrs = e.attributes
          { year: attrs["year"].text, month: attrs["month"].text, value: e.text.to_i }
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
vzaar-1.6.2 lib/vzaar/resources/user.rb
vzaar-1.6.1 lib/vzaar/resources/user.rb
vzaar-1.6.0 lib/vzaar/resources/user.rb
vzaar-1.5.3 lib/vzaar/resources/user.rb
vzaar-1.5.2 lib/vzaar/resources/user.rb
vzaar-1.5.1 lib/vzaar/resources/user.rb
vzaar-1.5.0 lib/vzaar/resources/user.rb
vzaar-1.4.4 lib/vzaar/resources/user.rb
vzaar-1.4.1 lib/vzaar/resources/user.rb
vzaar-1.3.1 lib/vzaar/resources/user.rb
vzaar-1.3.0 lib/vzaar/resources/user.rb
vzaar-1.2.4 lib/vzaar/resources/user.rb
vzaar-1.2.3 lib/vzaar/resources/user.rb
vzaar-1.2.2 lib/vzaar/resources/user.rb
vzaar-1.0.0 lib/vzaar/resources/user.rb