Class: Paynow::RequestBuilder

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

Overview

JSON body builder

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ RequestBuilder

Returns a new instance of RequestBuilder.



15
16
17
# File 'lib/paynow/request_builder.rb', line 15

def initialize(body)
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



9
10
11
# File 'lib/paynow/request_builder.rb', line 9

def body
  @body
end

Class Method Details

.build(body) ⇒ Object



11
12
13
# File 'lib/paynow/request_builder.rb', line 11

def self.build(body)
  new(body).build
end

Instance Method Details

#buildObject



19
20
21
# File 'lib/paynow/request_builder.rb', line 19

def build
  body.transform_keys(&camelize_proc).to_json
end