Class: BlipFm::User
- Inherits:
-
Object
- Object
- BlipFm::User
- Defined in:
- lib/blipfm.rb
Overview
BLIP CLASSES
Instance Attribute Summary collapse
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#create_time ⇒ Object
readonly
Returns the value of attribute create_time.
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#last_blip_time ⇒ Object
readonly
Returns the value of attribute last_blip_time.
-
#listener_count ⇒ Object
readonly
Returns the value of attribute listener_count.
-
#profile_pic_url ⇒ Object
readonly
Returns the value of attribute profile_pic_url.
-
#props_count ⇒ Object
readonly
Returns the value of attribute props_count.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#time_zone ⇒ Object
readonly
Returns the value of attribute time_zone.
-
#update_time ⇒ Object
readonly
Returns the value of attribute update_time.
-
#user_name ⇒ Object
readonly
Returns the value of attribute user_name.
-
#website_url ⇒ Object
readonly
Returns the value of attribute website_url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, display_name, profile_pic_url, status, props_count, country_code, user_name, website_url, time_zone, last_blip_time, create_time, update_time, listener_count) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(id, display_name, profile_pic_url, status, props_count, country_code, user_name, website_url, time_zone, last_blip_time, create_time, update_time, listener_count) ⇒ User
Returns a new instance of User.
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/blipfm.rb', line 205 def initialize(id, display_name, profile_pic_url, status, props_count, country_code, user_name, website_url, time_zone, last_blip_time, create_time, update_time, listener_count) @id = if_nill(id).strip @display_name = if_nill(display_name).strip @profile_pic_url = if_nill(profile_pic_url).strip @status = if_nill(status).strip @props_count = if_nill(props_count).strip @country_code = if_nill(country_code).strip @user_name = if_nill(user_name).strip @website_url = if_nill(website_url).strip @time_zone = if_nill(time_zone).strip @last_blip_time = if_nill(last_blip_time).strip @create_time = if_nill(create_time).strip @update_time = if_nill(update_time).strip @listener_count = if_nill(listener_count).strip end |
Instance Attribute Details
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code.
183 184 185 |
# File 'lib/blipfm.rb', line 183 def country_code @country_code end |
#create_time ⇒ Object (readonly)
Returns the value of attribute create_time.
183 184 185 |
# File 'lib/blipfm.rb', line 183 def create_time @create_time end |
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
183 184 185 |
# File 'lib/blipfm.rb', line 183 def display_name @display_name end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
183 184 185 |
# File 'lib/blipfm.rb', line 183 def id @id end |
#last_blip_time ⇒ Object (readonly)
Returns the value of attribute last_blip_time.
183 184 185 |
# File 'lib/blipfm.rb', line 183 def last_blip_time @last_blip_time end |
#listener_count ⇒ Object (readonly)
Returns the value of attribute listener_count.
183 184 185 |
# File 'lib/blipfm.rb', line 183 def listener_count @listener_count end |
#profile_pic_url ⇒ Object (readonly)
Returns the value of attribute profile_pic_url.
183 184 185 |
# File 'lib/blipfm.rb', line 183 def profile_pic_url @profile_pic_url end |
#props_count ⇒ Object (readonly)
Returns the value of attribute props_count.
183 184 185 |
# File 'lib/blipfm.rb', line 183 def props_count @props_count end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
183 184 185 |
# File 'lib/blipfm.rb', line 183 def status @status end |
#time_zone ⇒ Object (readonly)
Returns the value of attribute time_zone.
183 184 185 |
# File 'lib/blipfm.rb', line 183 def time_zone @time_zone end |
#update_time ⇒ Object (readonly)
Returns the value of attribute update_time.
183 184 185 |
# File 'lib/blipfm.rb', line 183 def update_time @update_time end |
#user_name ⇒ Object (readonly)
Returns the value of attribute user_name.
183 184 185 |
# File 'lib/blipfm.rb', line 183 def user_name @user_name end |
#website_url ⇒ Object (readonly)
Returns the value of attribute website_url.
183 184 185 |
# File 'lib/blipfm.rb', line 183 def website_url @website_url end |
Class Method Details
.create_by_xml(user_xml) ⇒ Object
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/blipfm.rb', line 185 def User.create_by_xml(user_xml) if (!user_xml.elements['id'].nil?) id = user_xml.elements['id'].text display_name = user_xml.elements['urlName'].text profile_pic_url = user_xml.elements['profilePic'].text status = user_xml.elements['status'].text props_count = user_xml.elements['propsCount'].text country_code = user_xml.elements['countryAbbr'].text user_name = user_xml.elements['name'].text website_url = user_xml.elements['website'].text time_zone = user_xml.elements['timeZone'].text last_blip_time = user_xml.elements['lastBlipTime'].text create_time = user_xml.elements['insTime'].text update_time = user_xml.elements['updateTime'].text listener_count = nil #user_xml.elements['listeners'].text User.new(id, display_name, profile_pic_url, status, props_count, country_code, user_name, website_url, time_zone, last_blip_time, create_time, update_time, listener_count) end end |