Class: StreamBuilder

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

Instance Method Summary collapse

Constructor Details

#initializeStreamBuilder

Returns a new instance of StreamBuilder.



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

def initialize
  @h = Hash['v',1,'d',{},'f',[],'l',[]]
end

Instance Method Details

#add(*args) ⇒ Object



21
22
23
24
25
# File 'lib/StreamBuilder.rb', line 21

def add( *args )
  @h['l'].concat args

  return self
end

#f(fieldList) ⇒ Object



15
16
17
18
19
# File 'lib/StreamBuilder.rb', line 15

def f( fieldList )
  @h['f'] = fieldList

  return self
end

#serializeObject



27
28
29
# File 'lib/StreamBuilder.rb', line 27

def serialize
  return @h.to_json
end

#set(name, value) ⇒ Object



10
11
12
13
# File 'lib/StreamBuilder.rb', line 10

def set( name, value )
  @h['d'][name] = value
  return self
end