Sha256: 46ebda87af143473eda52e93cc4bc9cc155249eabe017010aed194ef60f19de2

Contents?: true

Size: 1.02 KB

Versions: 21

Compression:

Stored size: 1.02 KB

Contents

module Etsy

  # = Profile
  #
  # Represents a profile resource of an Etsy user.
  #
  class Profile

    include Etsy::Model

    attribute :id, :from => :user_profile_id
    attribute :user_id
    attribute :bio
    attribute :username, :from => :login_name
    attribute :gender
    attribute :birth_day
    attribute :birth_month
    attribute :birth_year
    attribute :joined, :from => :join_tsz
    attribute :favorite_materials, :from => :materials
    attribute :country_id
    attribute :city
    attribute :location
    attribute :region
    attribute :avatar_id
    attribute :image, :from => :image_url_75x75
    attribute :lat
    attribute :lon
    attribute :transaction_buy_count
    attribute :transaction_sold_count
    attribute :is_seller
    attribute :first_name
    attribute :last_name

    def materials
      favorite_materials ? favorite_materials.split(',') : []
    end

    # Time that this user joined Etsy
    #
    def joined_at
      Time.at(joined)
    end

    def seller?
      is_seller
    end
  end
end

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
etsy-0.3.4 lib/etsy/profile.rb
etsy-0.3.3 lib/etsy/profile.rb
cardmagic-etsy-0.3.9 lib/etsy/profile.rb
cardmagic-etsy-0.3.8 lib/etsy/profile.rb
cardmagic-etsy-0.3.7 lib/etsy/profile.rb
cardmagic-etsy-0.3.6 lib/etsy/profile.rb
cardmagic-etsy-0.3.5 lib/etsy/profile.rb
cardmagic-etsy-0.3.4 lib/etsy/profile.rb
cardmagic-etsy-0.3.3 lib/etsy/profile.rb
cardmagic-etsy-0.3.2 lib/etsy/profile.rb
etsy-0.3.2 lib/etsy/profile.rb
etsy-0.3.1 lib/etsy/profile.rb
etsy-0.3.0 lib/etsy/profile.rb
etsy-0.2.7 lib/etsy/profile.rb
etsy-0.2.6 lib/etsy/profile.rb
etsy-0.2.5 lib/etsy/profile.rb
etsy-0.2.4 lib/etsy/profile.rb
etsy-0.2.3 lib/etsy/profile.rb
etsy-0.2.2 lib/etsy/profile.rb
tailored-etsy-0.2.2 lib/etsy/profile.rb