Class: AgentXmpp::Response

Inherits:
Object show all
Defined in:
lib/agent_xmpp/client/response.rb

Overview


Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Response) initialize(msg, &blk)

.........................................................................................................



16
17
18
19
20
# File 'lib/agent_xmpp/client/response.rb', line 16

def initialize(msg, &blk)
  @message = msg
  @text = msg.to_s
  @responds_with = blk
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(meth, *args, &blk)

.........................................................................................................



28
29
30
# File 'lib/agent_xmpp/client/response.rb', line 28

def method_missing(meth, *args, &blk)
  text.send(meth, *args, &blk)
end

Instance Attribute Details

- (Object) message (readonly)

.........................................................................................................



13
14
15
# File 'lib/agent_xmpp/client/response.rb', line 13

def message
  @message
end

- (Object) responds_with (readonly)

.........................................................................................................



13
14
15
# File 'lib/agent_xmpp/client/response.rb', line 13

def responds_with
  @responds_with
end

- (Object) text (readonly)

.........................................................................................................



13
14
15
# File 'lib/agent_xmpp/client/response.rb', line 13

def text
  @text
end

Instance Method Details

- (Object) to_s

.........................................................................................................



23
24
25
# File 'lib/agent_xmpp/client/response.rb', line 23

def to_s
  text
end