Class: GorgonAMQ::Protocol::Method
- Inherits:
-
Object
- Object
- GorgonAMQ::Protocol::Method
show all
- Defined in:
- lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb
Direct Known Subclasses
Basic::Ack, Basic::Cancel, Basic::CancelOk, Basic::Consume, Basic::ConsumeOk, Basic::Deliver, Basic::Get, Basic::GetEmpty, Basic::GetOk, Basic::Nack, Basic::Publish, Basic::Qos, Basic::QosOk, Basic::Recover, Basic::RecoverAsync, Basic::RecoverOk, Basic::Reject, Basic::Return, Channel::Close, Channel::CloseOk, Channel::Flow, Channel::FlowOk, Channel::Open, Channel::OpenOk, Confirm::Select, Confirm::SelectOk, Connection::Blocked, Connection::Close, Connection::CloseOk, Connection::Open, Connection::OpenOk, Connection::Secure, Connection::SecureOk, Connection::Start, Connection::StartOk, Connection::Tune, Connection::TuneOk, Connection::Unblocked, Exchange::Bind, Exchange::BindOk, Exchange::Declare, Exchange::DeclareOk, Exchange::Delete, Exchange::DeleteOk, Exchange::Unbind, Exchange::UnbindOk, Queue::Bind, Queue::BindOk, Queue::Declare, Queue::DeclareOk, Queue::Delete, Queue::DeleteOk, Queue::Purge, Queue::PurgeOk, Queue::Unbind, Queue::UnbindOk, Tx::Commit, Tx::CommitOk, Tx::Rollback, Tx::RollbackOk, Tx::Select, Tx::SelectOk
Class Method Summary
collapse
Class Method Details
.encode_body(body, channel, frame_size) ⇒ Object
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 164
def self.encode_body(body, channel, frame_size)
return [] if body.empty?
limit = frame_size - 8
return [BodyFrame.new(body, channel)] if body.bytesize < limit
body.force_encoding("ASCII-8BIT") if RUBY_VERSION.to_f >= 1.9
array = Array.new
while body && !body.empty?
payload, body = body[0, limit], body[limit, body.length - limit]
array << BodyFrame.new(payload, channel)
end
array
end
|
.index ⇒ Object
136
137
138
|
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 136
def self.index
@index
end
|
.inherited(base) ⇒ Object
140
141
142
143
144
|
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 140
def self.inherited(base)
if self == Protocol::Method
@methods << base
end
end
|
.instantiate(*args, &block) ⇒ Object
188
189
190
|
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 188
def self.instantiate(*args, &block)
self.new(*args, &block)
end
|
.method_id ⇒ Object
128
129
130
|
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 128
def self.method_id
@method_id
end
|
.methods ⇒ Object
146
147
148
|
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 146
def self.methods
@methods
end
|
.name ⇒ Object
132
133
134
|
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 132
def self.name
@name
end
|
150
151
152
153
154
155
156
157
158
159
160
161
162
|
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 150
def self.()
properties, = {}, {}
.each do |key, value|
if Basic::PROPERTIES.include?(key)
properties[key] = value
else
[key] = value
end
end
return [properties, ]
end
|