Class: Thingiverse::Users
- Inherits:
-
Object
- Object
- Thingiverse::Users
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/thingiverse/users.rb
Instance Attribute Summary collapse
-
#bio ⇒ Object
Returns the value of attribute bio.
-
#copies_url ⇒ Object
Returns the value of attribute copies_url.
-
#default_license ⇒ Object
Returns the value of attribute default_license.
-
#email ⇒ Object
Returns the value of attribute email.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_active ⇒ Object
Returns the value of attribute last_active.
-
#likes_url ⇒ Object
Returns the value of attribute likes_url.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
-
#public_url ⇒ Object
Returns the value of attribute public_url.
-
#registered ⇒ Object
Returns the value of attribute registered.
-
#things_url ⇒ Object
Returns the value of attribute things_url.
-
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(attributes = {}) ⇒ Users
constructor
A new instance of Users.
Constructor Details
#initialize(attributes = {}) ⇒ Users
Returns a new instance of Users.
10 11 12 13 14 |
# File 'lib/thingiverse/users.rb', line 10 def initialize(attributes={}) attributes.each do |name, value| send("#{name}=", value) end end |
Instance Attribute Details
#bio ⇒ Object
Returns the value of attribute bio.
6 7 8 |
# File 'lib/thingiverse/users.rb', line 6 def bio @bio end |
#copies_url ⇒ Object
Returns the value of attribute copies_url.
8 9 10 |
# File 'lib/thingiverse/users.rb', line 8 def copies_url @copies_url end |
#default_license ⇒ Object
Returns the value of attribute default_license.
7 8 9 |
# File 'lib/thingiverse/users.rb', line 7 def default_license @default_license end |
#email ⇒ Object
Returns the value of attribute email.
7 8 9 |
# File 'lib/thingiverse/users.rb', line 7 def email @email end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/thingiverse/users.rb', line 6 def id @id end |
#last_active ⇒ Object
Returns the value of attribute last_active.
6 7 8 |
# File 'lib/thingiverse/users.rb', line 6 def last_active @last_active end |
#likes_url ⇒ Object
Returns the value of attribute likes_url.
8 9 10 |
# File 'lib/thingiverse/users.rb', line 8 def likes_url @likes_url end |
#location ⇒ Object
Returns the value of attribute location.
6 7 8 |
# File 'lib/thingiverse/users.rb', line 6 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/thingiverse/users.rb', line 6 def name @name end |
#public_url ⇒ Object
Returns the value of attribute public_url.
6 7 8 |
# File 'lib/thingiverse/users.rb', line 6 def public_url @public_url end |
#registered ⇒ Object
Returns the value of attribute registered.
6 7 8 |
# File 'lib/thingiverse/users.rb', line 6 def registered @registered end |
#things_url ⇒ Object
Returns the value of attribute things_url.
8 9 10 |
# File 'lib/thingiverse/users.rb', line 8 def things_url @things_url end |
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
6 7 8 |
# File 'lib/thingiverse/users.rb', line 6 def thumbnail @thumbnail end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/thingiverse/users.rb', line 6 def url @url end |
Class Method Details
.find(user_name) ⇒ Object
35 36 37 38 39 |
# File 'lib/thingiverse/users.rb', line 35 def self.find(user_name) response = Thingiverse::Connection.get("/users/#{user_name}") raise "#{response.code}: #{JSON.parse(response.body)['error']}" unless response.success? self.new response.parsed_response end |
Instance Method Details
#attributes ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/thingiverse/users.rb', line 16 def attributes { :id => id, :name => name, :thumbnail => thumbnail, :url => url, :public_url => public_url, :bio => bio, :location => location, :registered => registered, :last_active => last_active, :things_url => things_url, :copies_url => copies_url, :likes_url => likes_url, :email => email, :default_license => default_license } end |