Class: LanGrove::Protocol::Base

Inherits:
Base
  • Object
show all
Defined in:
lib/langrove/protocol/protocol_base.rb

Overview

protocol |noun| ~ obsessive compulsive notation

eg. #
    #
    # spread eagled code commentry
    #
    #

Instance Attribute Summary

Attributes inherited from Base

#logger

Instance Method Summary collapse

Methods inherited from Base

#config_exception, #type

Constructor Details

#initialize(root, config, name) ⇒ Base

Returns a new instance of Base.



18
19
20
21
22
23
24
# File 'lib/langrove/protocol/protocol_base.rb', line 18

def initialize( root, config, name )
  
  super( root )
  
  @config = config
  
end

Instance Method Details

#decode(data) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/langrove/protocol/protocol_base.rb', line 26

def decode( data )
  
  #
  # OVERRIDE 
  #
  # To decode the data ahead of passing it
  # into the <Handler>.receive() function.
  #
  
  {
    
    :data => data
    
  }
  
end

#encode(data) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/langrove/protocol/protocol_base.rb', line 43

def encode( data ) 
  
  #
  # OVERRIDE
  #
  # To encode to data ahead of transmit
  # -ting it to the Client
  # 
  
  data[ :data ]
  
end