Class: Moqueue::MockHeaders

Inherits:
Object
  • Object
show all
Defined in:
lib/moqueue/mock_headers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(properties = {}) ⇒ MockHeaders

Returns a new instance of MockHeaders.



6
7
8
# File 'lib/moqueue/mock_headers.rb', line 6

def initialize(properties={})
  @properties = properties
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &blk) ⇒ Object



26
27
28
# File 'lib/moqueue/mock_headers.rb', line 26

def method_missing method, *args, &blk
  @properties.has_key?(method) ? @properties[method] : super
end

Instance Attribute Details

#sizeObject

Returns the value of attribute size.



4
5
6
# File 'lib/moqueue/mock_headers.rb', line 4

def size
  @size
end

#weightObject

Returns the value of attribute weight.



4
5
6
# File 'lib/moqueue/mock_headers.rb', line 4

def weight
  @weight
end

Instance Method Details

#ackObject



10
11
12
# File 'lib/moqueue/mock_headers.rb', line 10

def ack
  @received_ack = true
end

#propertiesObject



18
19
20
# File 'lib/moqueue/mock_headers.rb', line 18

def properties
  @properties
end

#received_ack?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/moqueue/mock_headers.rb', line 14

def received_ack?
  @received_ack || false
end

#to_frameObject



22
23
24
# File 'lib/moqueue/mock_headers.rb', line 22

def to_frame
  nil
end