Class: BlipFm::User

Inherits:
Object
  • Object
show all
Defined in:
lib/blipfm.rb

Overview

BLIP CLASSES

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_codeObject (readonly)

Returns the value of attribute country_code.



183
184
185
# File 'lib/blipfm.rb', line 183

def country_code
  @country_code
end

#create_timeObject (readonly)

Returns the value of attribute create_time.



183
184
185
# File 'lib/blipfm.rb', line 183

def create_time
  @create_time
end

#display_nameObject (readonly)

Returns the value of attribute display_name.



183
184
185
# File 'lib/blipfm.rb', line 183

def display_name
  @display_name
end

#idObject (readonly)

Returns the value of attribute id.



183
184
185
# File 'lib/blipfm.rb', line 183

def id
  @id
end

#last_blip_timeObject (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_countObject (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_urlObject (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_countObject (readonly)

Returns the value of attribute props_count.



183
184
185
# File 'lib/blipfm.rb', line 183

def props_count
  @props_count
end

#statusObject (readonly)

Returns the value of attribute status.



183
184
185
# File 'lib/blipfm.rb', line 183

def status
  @status
end

#time_zoneObject (readonly)

Returns the value of attribute time_zone.



183
184
185
# File 'lib/blipfm.rb', line 183

def time_zone
  @time_zone
end

#update_timeObject (readonly)

Returns the value of attribute update_time.



183
184
185
# File 'lib/blipfm.rb', line 183

def update_time
  @update_time
end

#user_nameObject (readonly)

Returns the value of attribute user_name.



183
184
185
# File 'lib/blipfm.rb', line 183

def user_name
  @user_name
end

#website_urlObject (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