Class: Trustly::Data::Request

Inherits:
Trustly::Data show all
Defined in:
lib/trustly/data/request.rb

Direct Known Subclasses

JSONRPCRequest

Instance Attribute Summary collapse

Attributes inherited from Trustly::Data

#payload

Instance Method Summary collapse

Methods inherited from Trustly::Data

#get, #get_from, #json, #pop, #set, #set_in, #vacumm

Constructor Details

#initialize(method = nil, payload = nil) ⇒ Request

Returns a new instance of Request.



5
6
7
8
9
10
11
12
13
# File 'lib/trustly/data/request.rb', line 5

def initialize(method=nil,payload=nil)
  super
  self.payload = self.vacuum(payload) unless payload.nil?
  unless method.nil?
    self.method  = method
  else
    self.method  = self.payload.get('method')
  end
end

Instance Attribute Details

#methodObject

Returns the value of attribute method.



3
4
5
# File 'lib/trustly/data/request.rb', line 3

def method
  @method
end

Instance Method Details

#get_methodObject



15
16
17
# File 'lib/trustly/data/request.rb', line 15

def get_method
  return self.method
end

#get_uuidObject



24
25
26
# File 'lib/trustly/data/request.rb', line 24

def get_uuid
  return self.payload.get('uuid')
end

#set_method(method) ⇒ Object



19
20
21
22
# File 'lib/trustly/data/request.rb', line 19

def set_method(method)
  self.method = method
  return method
end

#set_uuidObject



28
29
30
31
# File 'lib/trustly/data/request.rb', line 28

def set_uuid
  self.set('uuid',uuid)
  return uuid
end