Class: User

Inherits:
Object
  • Object
show all
Defined in:
lib/model/USMF/user.rb

Overview

Models a User into USMF standard

Author:

  • Daniel Machado Fernandez

Version:

  • 1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#avatarObject

Returns the value of attribute avatar.



7
8
9
# File 'lib/model/USMF/user.rb', line 7

def avatar
  @avatar
end

#descriptionObject

Returns the value of attribute description.



7
8
9
# File 'lib/model/USMF/user.rb', line 7

def description
  @description
end

#geoObject

Returns the value of attribute geo.



7
8
9
# File 'lib/model/USMF/user.rb', line 7

def geo
  @geo
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/model/USMF/user.rb', line 7

def id
  @id
end

#languageObject

Returns the value of attribute language.



7
8
9
# File 'lib/model/USMF/user.rb', line 7

def language
  @language
end

#locationObject

Returns the value of attribute location.



7
8
9
# File 'lib/model/USMF/user.rb', line 7

def location
  @location
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/model/USMF/user.rb', line 7

def name
  @name
end

#postingsObject

Returns the value of attribute postings.



7
8
9
# File 'lib/model/USMF/user.rb', line 7

def postings
  @postings
end

#profileObject

Returns the value of attribute profile.



7
8
9
# File 'lib/model/USMF/user.rb', line 7

def profile
  @profile
end

#real_nameObject

Returns the value of attribute real_name.



7
8
9
# File 'lib/model/USMF/user.rb', line 7

def real_name
  @real_name
end

#subscribersObject

Returns the value of attribute subscribers.



7
8
9
# File 'lib/model/USMF/user.rb', line 7

def subscribers
  @subscribers
end

#subscriptionsObject

Returns the value of attribute subscriptions.



7
8
9
# File 'lib/model/USMF/user.rb', line 7

def subscriptions
  @subscriptions
end

#utcObject

Returns the value of attribute utc.



7
8
9
# File 'lib/model/USMF/user.rb', line 7

def utc
  @utc
end

#websiteObject

Returns the value of attribute website.



7
8
9
# File 'lib/model/USMF/user.rb', line 7

def website
  @website
end

Instance Method Details

#to_hashHash

Unify the fields into a hash

Returns:

  • (Hash)

    resultant hash



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/model/USMF/user.rb', line 21

def to_hash
	res = {
			"name" => name,
			"real_name" => real_name,
			"id" => id,
			"language" => language,
			"utc" => utc,
			"geo" => geo,
			"description" => description,
			"avatar" => avatar,
			"location" => location,
			"subscribers" => subscribers,
			"subscriptions" => subscriptions,
			"postings" => postings,
			"profile" => profile,
			"website" => website
		  }
	res
end

#to_sString

Returns resultant string.

Returns:

  • (String)

    resultant string



13
14
15
16
# File 'lib/model/USMF/user.rb', line 13

def to_s
	res = "\nname: " + name.to_s + "\nreal_name: " + real_name.to_s + "\nid: " + id.to_s + "\nlanguage: " + language.to_s + "\nutc: " + utc.to_s + "\ngeo: " + geo.to_s + "\ndescription: " + description.to_s + "\navatar: " + avatar.to_s + "\nlocation: " + location.to_s + "\nsubscribers: " + subscribers.to_s + "\nsubscriptions: " + subscriptions.to_s + "\npostings: " + postings.to_s + "\nprofile: " + profile.to_s + "\nwebsite: " + website.to_s
	res
end