Module: Hara
- Defined in:
- lib/hara.rb,
lib/hara/app.rb,
lib/hara/filter.rb,
lib/hara/server.rb,
lib/hara/version.rb,
lib/hara/client_interaction.rb
Defined Under Namespace
Modules: App, ClientInteraction, Filter
Classes: DuplicateResponseError, Server
Constant Summary
collapse
- VERSION =
"0.4.0"
Class Method Summary
collapse
Class Method Details
.decode_msg(msg) ⇒ Object
decode message, return action and args
6
7
8
|
# File 'lib/hara.rb', line 6
def decode_msg msg
JSON.parse msg
end
|
.encode_msg(msg) ⇒ Object
10
11
12
|
# File 'lib/hara.rb', line 10
def encode_msg msg
msg.to_json
end
|
.filter_class ⇒ Object
14
15
16
|
# File 'lib/hara.rb', line 14
def filter_class
@filter_class || DefaultFilter
end
|
.filter_class=(klass) ⇒ Object
18
19
20
|
# File 'lib/hara.rb', line 18
def filter_class= klass
@filter_class = klass
end
|
.filter_pool ⇒ Object
30
31
32
|
# File 'lib/hara.rb', line 30
def filter_pool
@filter_pool ||= filter_class.pool(size: filter_pool_size)
end
|
.filter_pool_size ⇒ Object
26
27
28
|
# File 'lib/hara.rb', line 26
def filter_pool_size
@filter_pool_size || 10
end
|
.filter_pool_size=(size) ⇒ Object
22
23
24
|
# File 'lib/hara.rb', line 22
def filter_pool_size= size
@filter_pool_size = size
end
|