Class: Http2::PostDataGenerator

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

Instance Method Summary collapse

Constructor Details

#initialize(pdata, args = {}) ⇒ PostDataGenerator

Returns a new instance of PostDataGenerator.



2
3
4
5
# File 'lib/http2/post_data_generator.rb', line 2

def initialize(pdata, args = {})
  @pdata = pdata
  @args = args
end

Instance Method Details

#generateObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/http2/post_data_generator.rb', line 7

def generate
  praw = ""

  if @pdata.is_a?(Hash)
    praw << generate_for_hash(@pdata)
  elsif @pdata.is_a?(Array)
    praw << generate_for_array(@pdata)
  else
    return @pdata.to_s
  end

  praw
end