Class: Howcast::Client::User

Inherits:
Object
  • Object
show all
Extended by:
WatchAttrAccessors
Includes:
XmlMethods
Defined in:
lib/howcast/client/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WatchAttrAccessors

attr_accessor, attr_accessors

Methods included from XmlMethods

#to_doc, #to_xml

Constructor Details

#initialize(attributes = {}) ⇒ User

Creates a new User object which is used to encapsulate all the attributes available from the Howcast user profile API.

Inputs

  • attributes – A hash to set the various attributes of the user object

Examples

Initialize a user with login “someone”

User.new :login => "someone"


42
43
44
45
46
# File 'lib/howcast/client/user.rb', line 42

def initialize(attributes={})
  attributes.each do |k, v|
    self.send("#{k}=", v) if self.respond_to?(k)
  end
end

Instance Attribute Details

#countObject

Returns the value of attribute count.



29
30
31
# File 'lib/howcast/client/user.rb', line 29

def count
  @count
end

#firstnameObject

Returns the value of attribute firstname.



29
30
31
# File 'lib/howcast/client/user.rb', line 29

def firstname
  @firstname
end

#lastnameObject

Returns the value of attribute lastname.



29
30
31
# File 'lib/howcast/client/user.rb', line 29

def lastname
  @lastname
end

#loginObject

Returns the value of attribute login.



29
30
31
# File 'lib/howcast/client/user.rb', line 29

def 
  @login
end

#thumbnail_urlObject

Returns the value of attribute thumbnail_url.



29
30
31
# File 'lib/howcast/client/user.rb', line 29

def thumbnail_url
  @thumbnail_url
end

#videosObject

Returns the value of attribute videos.



29
30
31
# File 'lib/howcast/client/user.rb', line 29

def videos
  @videos
end

#viewsObject

Returns the value of attribute views.



29
30
31
# File 'lib/howcast/client/user.rb', line 29

def views
  @views
end