Class: Del::User
- Inherits:
-
Object
- Object
- Del::User
- Defined in:
- lib/del/user.rb
Overview
An XMPP user.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#jid ⇒ Object
readonly
Returns the value of attribute jid.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(jid, attributes) ⇒ User
constructor
A new instance of User.
- #mention_name ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(jid, attributes) ⇒ User
Returns a new instance of User.
8 9 10 11 |
# File 'lib/del/user.rb', line 8 def initialize(jid, attributes) @jid = jid @attributes = attributes || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
6 7 8 |
# File 'lib/del/user.rb', line 6 def attributes @attributes end |
#jid ⇒ Object (readonly)
Returns the value of attribute jid.
6 7 8 |
# File 'lib/del/user.rb', line 6 def jid @jid end |
Class Method Details
.map_from(attributes) ⇒ Object
21 22 23 24 25 |
# File 'lib/del/user.rb', line 21 def self.map_from(attributes) return nil if attributes.nil? new(attributes['jid'], attributes) end |
Instance Method Details
#mention_name ⇒ Object
13 14 15 |
# File 'lib/del/user.rb', line 13 def mention_name attributes[:mention_name] end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/del/user.rb', line 17 def to_s YAML.dump(attributes) end |