Class: RedisProtocol::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/redis-protocol/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Request

Returns a new instance of Request.



6
7
8
9
10
11
# File 'lib/redis-protocol/request.rb', line 6

def initialize(data)
  @raw_data = data
  @type, @components= nil, []
  @next_length = 0
  parse
end

Instance Attribute Details

#componentsObject (readonly)

Returns the value of attribute components.



4
5
6
# File 'lib/redis-protocol/request.rb', line 4

def components
  @components
end

#raw_dataObject (readonly)

Returns the value of attribute raw_data.



4
5
6
# File 'lib/redis-protocol/request.rb', line 4

def raw_data
  @raw_data
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/redis-protocol/request.rb', line 4

def type
  @type
end

Instance Method Details

#component_countObject



13
14
15
# File 'lib/redis-protocol/request.rb', line 13

def component_count
  @components.length
end