Class: USMF
Overview
USMF standard message from Tawlk
Constant Summary
Constants included from Logging
Instance Attribute Summary collapse
-
#application ⇒ Object
Returns the value of attribute application.
-
#category ⇒ Object
Returns the value of attribute category.
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#date ⇒ Object
Returns the value of attribute date.
-
#description ⇒ Object
Returns the value of attribute description.
-
#dislikes ⇒ Object
Returns the value of attribute dislikes.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#favorites ⇒ Object
Returns the value of attribute favorites.
-
#geo ⇒ Object
Returns the value of attribute geo.
-
#id ⇒ Object
Returns the value of attribute id.
-
#keywords ⇒ Object
Returns the value of attribute keywords.
-
#likes ⇒ Object
Returns the value of attribute likes.
-
#links ⇒ Object
Returns the value of attribute links.
-
#location ⇒ Object
Returns the value of attribute location.
-
#max_rating ⇒ Object
Returns the value of attribute max_rating.
-
#min_rating ⇒ Object
Returns the value of attribute min_rating.
-
#rates ⇒ Object
Returns the value of attribute rates.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#service ⇒ Object
Returns the value of attribute service.
-
#source ⇒ Object
Returns the value of attribute source.
-
#text ⇒ Object
Returns the value of attribute text.
-
#to_users ⇒ Object
Returns the value of attribute to_users.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#to_hash ⇒ Hash
Unify the fields into a hash.
-
#to_s ⇒ String
Unify the fields into a string.
Methods included from Logging
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def application @application end |
#category ⇒ Object
Returns the value of attribute category.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def category @category end |
#comments ⇒ Object
Returns the value of attribute comments.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def comments @comments end |
#date ⇒ Object
Returns the value of attribute date.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def date @date end |
#description ⇒ Object
Returns the value of attribute description.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def description @description end |
#dislikes ⇒ Object
Returns the value of attribute dislikes.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def dislikes @dislikes end |
#duration ⇒ Object
Returns the value of attribute duration.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def duration @duration end |
#favorites ⇒ Object
Returns the value of attribute favorites.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def favorites @favorites end |
#geo ⇒ Object
Returns the value of attribute geo.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def geo @geo end |
#id ⇒ Object
Returns the value of attribute id.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def id @id end |
#keywords ⇒ Object
Returns the value of attribute keywords.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def keywords @keywords end |
#likes ⇒ Object
Returns the value of attribute likes.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def likes @likes end |
#links ⇒ Object
Returns the value of attribute links.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def links @links end |
#location ⇒ Object
Returns the value of attribute location.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def location @location end |
#max_rating ⇒ Object
Returns the value of attribute max_rating.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def @max_rating end |
#min_rating ⇒ Object
Returns the value of attribute min_rating.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def @min_rating end |
#rates ⇒ Object
Returns the value of attribute rates.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def rates @rates end |
#rating ⇒ Object
Returns the value of attribute rating.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def @rating end |
#service ⇒ Object
Returns the value of attribute service.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def service @service end |
#source ⇒ Object
Returns the value of attribute source.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def source @source end |
#text ⇒ Object
Returns the value of attribute text.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def text @text end |
#to_users ⇒ Object
Returns the value of attribute to_users.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def to_users @to_users end |
#user ⇒ Object
Returns the value of attribute user.
13 14 15 |
# File 'lib/model/USMF/USMF.rb', line 13 def user @user end |
Instance Method Details
#to_hash ⇒ Hash
Unify the fields into a hash
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/model/USMF/USMF.rb', line 29 def to_hash res = { "service" => service, "id" => id, "geo" => geo, "application" => application, "location" => location, "date" => date, "source" => source, "text" => text, "description" => description, "keywords" => keywords, "category" => category, "duration" => duration, "likes" => likes, "dislikes" => dislikes, "favorites" => favorites, "comments" => comments, "rates" => rates, "rating" => , "min_rating" => , "max_rating" => } l = [] unless :links == nil links.each do |link| l << link.to_hash end res["links"] = l end tu = [] unless :to_users == nil to_users.each do |us| tu << us.to_hash end res["to_users"] = tu end begin if :user != nil res["user"] = user.to_hash end rescue #Sometimes a corrupt user was found res = nil end res end |
#to_s ⇒ String
Unify the fields into a string
19 20 21 22 23 24 |
# File 'lib/model/USMF/USMF.rb', line 19 def to_s res = "\nservice: " + service.to_s + "\nid: " + id.to_s + "\ngeo: " + geo.to_s + "\napplication: " + application.to_s + "\nlocation: " + location.to_s + "\ndate: " + date.to_s + "\nsource: " + source.to_s + "\ntext: " + text.to_s + "\ndescription: " + description.to_s + "\nkeywords: " + keywords.to_s + "\ncategory: " + category.to_s + "\nduration: " + duration.to_s + "\nlikes: " + likes.to_s + "\ndislikes: " + dislikes.to_s + "\nfavorites: " + favorites.to_s + "\ncomments: " + comments.to_s + "\nrates: " + rates.to_s + "\nrating: " + .to_s + "\nmin_rating: " + .to_s + "\nmax_rating: " + .to_s + "\n[USER]: " + user.to_s + "\n[TO_USERS]: " + to_users.to_s + "\n[LINKS]: " + links.to_s res end |