Class: Birt::Core::DataSource
- Inherits:
-
Object
- Object
- Birt::Core::DataSource
- Defined in:
- lib/birt/core/data_source.rb
Instance Attribute Summary collapse
-
#database ⇒ Object
Returns the value of attribute database.
-
#host ⇒ Object
Returns the value of attribute host.
-
#name ⇒ Object
Returns the value of attribute name.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(xml_element = nil) {|_self| ... } ⇒ DataSource
constructor
A new instance of DataSource.
- #set_host(host) ⇒ Object
Constructor Details
#initialize(xml_element = nil) {|_self| ... } ⇒ DataSource
Returns a new instance of DataSource.
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
#database ⇒ Object
Returns the value of attribute database.
8 9 10 |
# File 'lib/birt/core/data_source.rb', line 8 def database @database end |
#host ⇒ Object
Returns the value of attribute host.
4 5 6 |
# File 'lib/birt/core/data_source.rb', line 4 def host @host end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/birt/core/data_source.rb', line 3 def name @name end |
#password ⇒ Object
Returns the value of attribute password.
7 8 9 |
# File 'lib/birt/core/data_source.rb', line 7 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/birt/core/data_source.rb', line 5 def port @port end |
#username ⇒ Object
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 |