Class: Connectors::Example::Connector
Class Method Summary
collapse
Instance Method Summary
collapse
#do_health_check!, #is_healthy?
Constructor Details
#initialize(configuration: {}) ⇒ Connector
Returns a new instance of Connector.
32
33
34
|
# File 'lib/connectors/example/connector.rb', line 32
def initialize(configuration: {})
super
end
|
Class Method Details
.configurable_fields ⇒ Object
23
24
25
26
27
28
29
30
|
# File 'lib/connectors/example/connector.rb', line 23
def self.configurable_fields
{
'foo' => {
'label' => 'Foo',
'value' => nil
}
}
end
|
.display_name ⇒ Object
19
20
21
|
# File 'lib/connectors/example/connector.rb', line 19
def self.display_name
'Example Connector'
end
|
.service_type ⇒ Object
15
16
17
|
# File 'lib/connectors/example/connector.rb', line 15
def self.service_type
'example'
end
|
Instance Method Details
#do_health_check ⇒ Object
36
37
38
39
40
41
|
# File 'lib/connectors/example/connector.rb', line 36
def do_health_check
end
|
#yield_documents ⇒ Object
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/connectors/example/connector.rb', line 43
def yield_documents
attachments = [
File.open('./lib/connectors/example/example_attachments/first_attachment.txt'),
File.open('./lib/connectors/example/example_attachments/second_attachment.txt'),
File.open('./lib/connectors/example/example_attachments/third_attachment.txt')
]
attachments.each_with_index do |att, index|
data = { id: (index + 1).to_s, name: "example document #{index + 1}", _attachment: File.read(att) }
yield data
end
end
|