Class: Blather::Stanza::Presence::MUCUser::Status

Inherits:
XMPPNode
  • Object
show all
Defined in:
lib/blather/stanza/presence/muc_user.rb

Constant Summary

Constants inherited from XMPPNode

XMPPNode::BASE_NAMES

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from XMPPNode

class_from_registration, #decorate, decorator_modules, import, parse, register, #to_stanza

Class Method Details

.new(code = nil) ⇒ Object



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/blather/stanza/presence/muc_user.rb', line 119

def self.new(code = nil)
  new_node = super :status

  case code
  when self.class
    return code
  when Nokogiri::XML::Node
    new_node.inherit code
  when Hash
    new_node.code = code[:code]
  else
    new_node.code = code
  end
  new_node
end

Instance Method Details

#codeObject



135
136
137
# File 'lib/blather/stanza/presence/muc_user.rb', line 135

def code
  read_attr :code, :to_i
end

#code=(val) ⇒ Object



139
140
141
# File 'lib/blather/stanza/presence/muc_user.rb', line 139

def code=(val)
  write_attr :code, val
end