Class: Birt::Core::DataSource

Inherits:
Object
  • Object
show all
Defined in:
lib/birt/core/data_source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml_element = nil) {|_self| ... } ⇒ DataSource

Returns a new instance of DataSource.

Yields:

  • (_self)

Yield Parameters:



10
11
12
13
14
15
16
17
18
# File 'lib/birt/core/data_source.rb', line 10

def initialize(xml_element = nil)
  if xml_element
    self.name = xml_element.attribute(:name).value
    self.host = xml_element.get_elements("property[@name='odaURL']")[0].text
    self.username = xml_element.get_elements("property[@name='odaUser']")[0].text
    self.password = Base64.decode64 xml_element.get_elements("encrypted-property[@name='odaPassword']")[0].text
  end
  yield(self) if block_given?
end

Instance Attribute Details

#databaseObject

Returns the value of attribute database.



8
9
10
# File 'lib/birt/core/data_source.rb', line 8

def database
  @database
end

#hostObject

Returns the value of attribute host.



4
5
6
# File 'lib/birt/core/data_source.rb', line 4

def host
  @host
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/birt/core/data_source.rb', line 3

def name
  @name
end

#passwordObject

Returns the value of attribute password.



7
8
9
# File 'lib/birt/core/data_source.rb', line 7

def password
  @password
end

#portObject

Returns the value of attribute port.



5
6
7
# File 'lib/birt/core/data_source.rb', line 5

def port
  @port
end

#usernameObject

Returns the value of attribute username.



6
7
8
# File 'lib/birt/core/data_source.rb', line 6

def username
  @username
end

Instance Method Details

#set_host(host) ⇒ Object



27
28
29
# File 'lib/birt/core/data_source.rb', line 27

def set_host(host)
  @host = host
end