Class: ProcessOut::Gateway

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Gateway

Initializes the Gateway object Params:

client

ProcessOut client instance



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/processout/gateway.rb', line 56

def initialize(client)
  @client = client

  @id = ""
  @name = ""
  @display_name = ""
  @logo_url = ""
  @url = ""
  @flows = Array.new
  @tags = Array.new
  @description = ""
  
end

Instance Attribute Details

#description ⇒ Object

Returns the value of attribute description.



17
18
19
# File 'lib/processout/gateway.rb', line 17

def description
  @description
end

#display_name ⇒ Object

Returns the value of attribute display_name.



12
13
14
# File 'lib/processout/gateway.rb', line 12

def display_name
  @display_name
end

#flows ⇒ Object

Returns the value of attribute flows.



15
16
17
# File 'lib/processout/gateway.rb', line 15

def flows
  @flows
end

#id ⇒ Object

Returns the value of attribute id.



10
11
12
# File 'lib/processout/gateway.rb', line 10

def id
  @id
end

#logo_url ⇒ Object

Returns the value of attribute logo_url.



13
14
15
# File 'lib/processout/gateway.rb', line 13

def logo_url
  @logo_url
end

#name ⇒ Object

Returns the value of attribute name.



11
12
13
# File 'lib/processout/gateway.rb', line 11

def name
  @name
end

#tags ⇒ Object

Returns the value of attribute tags.



16
17
18
# File 'lib/processout/gateway.rb', line 16

def tags
  @tags
end

#url ⇒ Object

Returns the value of attribute url.



14
15
16
# File 'lib/processout/gateway.rb', line 14

def url
  @url
end

Instance Method Details

#fill_with_data(data) ⇒ Object

Fills the object with data coming from the API Params:

data

Hash of data coming from the API



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/processout/gateway.rb', line 73

def fill_with_data(data)
  if data.include? "id"
    @id = data["id"]
  end
  if data.include? "name"
    @name = data["name"]
  end
  if data.include? "display_name"
    @display_name = data["display_name"]
  end
  if data.include? "logo_url"
    @logo_url = data["logo_url"]
  end
  if data.include? "url"
    @url = data["url"]
  end
  if data.include? "flows"
    @flows = data["flows"]
  end
  if data.include? "tags"
    @tags = data["tags"]
  end
  if data.include? "description"
    @description = data["description"]
  end
  
  self
end