Class: Fetion::Contact
- Inherits:
-
Object
- Object
- Fetion::Contact
- Defined in:
- lib/rfetion/contact.rb
Constant Summary collapse
- STATUS =
{ "400" => "在线", "300" => "离开", "600" => "繁忙", "0" => "脱机" }
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#impresa ⇒ Object
Returns the value of attribute impresa.
-
#mobile_no ⇒ Object
Returns the value of attribute mobile_no.
-
#nickname ⇒ Object
Returns the value of attribute nickname.
-
#sid ⇒ Object
Returns the value of attribute sid.
-
#status ⇒ Object
Returns the value of attribute status.
-
#uri ⇒ Object
Returns the value of attribute uri.
Class Method Summary collapse
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/rfetion/contact.rb', line 4 def id @id end |
#impresa ⇒ Object
Returns the value of attribute impresa.
4 5 6 |
# File 'lib/rfetion/contact.rb', line 4 def impresa @impresa end |
#mobile_no ⇒ Object
Returns the value of attribute mobile_no.
4 5 6 |
# File 'lib/rfetion/contact.rb', line 4 def mobile_no @mobile_no end |
#nickname ⇒ Object
Returns the value of attribute nickname.
4 5 6 |
# File 'lib/rfetion/contact.rb', line 4 def nickname @nickname end |
#sid ⇒ Object
Returns the value of attribute sid.
4 5 6 |
# File 'lib/rfetion/contact.rb', line 4 def sid @sid end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/rfetion/contact.rb', line 4 def status @status end |
#uri ⇒ Object
Returns the value of attribute uri.
4 5 6 |
# File 'lib/rfetion/contact.rb', line 4 def uri @uri end |
Class Method Details
.parse(c) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rfetion/contact.rb', line 13 def self.parse(c) contact = self.new contact.id = c['id'] p = c.children.first contact.sid = p["sid"] contact.uri = p["su"] contact.mobile_no = p["m"] contact.nickname = p["n"] contact.impresa = p["i"] contact.status = p["b"] contact end |