Class: DataSource
- Inherits:
-
Object
- Object
- DataSource
- Defined in:
- lib/datasource.rb
Constant Summary collapse
- @@hasher =
Digest::SHA256.new
Instance Attribute Summary collapse
-
#caption ⇒ Object
readonly
Returns the value of attribute caption.
-
#class ⇒ Object
readonly
Returns the value of attribute class.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#connHash ⇒ Object
readonly
Returns the value of attribute connHash.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#uiname ⇒ Object
readonly
Returns the value of attribute uiname.
Instance Method Summary collapse
-
#initialize(dataSourceNode) ⇒ DataSource
constructor
A new instance of DataSource.
- #processConnection ⇒ Object
Constructor Details
#initialize(dataSourceNode) ⇒ DataSource
Returns a new instance of DataSource.
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/datasource.rb', line 25 def initialize dataSourceNode @node = dataSourceNode @name = @node.xpath('./@name').text @caption = @node.xpath('./@caption').text @uiname = if @caption.nil? || @caption == '' then @name else @caption end # puts "DS: n:#{@name}" # puts " caption:#{@caption}" # puts " c.len :#{@caption.length}" # puts " c.nil?:#{@caption.nil?}" # puts " uiname:#{@uiname}" # puts " " processConnection end |
Instance Attribute Details
#caption ⇒ Object (readonly)
Returns the value of attribute caption.
23 24 25 |
# File 'lib/datasource.rb', line 23 def @caption end |
#class ⇒ Object (readonly)
Returns the value of attribute class.
23 24 25 |
# File 'lib/datasource.rb', line 23 def class @class end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
23 24 25 |
# File 'lib/datasource.rb', line 23 def connection @connection end |
#connHash ⇒ Object (readonly)
Returns the value of attribute connHash.
23 24 25 |
# File 'lib/datasource.rb', line 23 def connHash @connHash end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
23 24 25 |
# File 'lib/datasource.rb', line 23 def name @name end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
23 24 25 |
# File 'lib/datasource.rb', line 23 def node @node end |
#uiname ⇒ Object (readonly)
Returns the value of attribute uiname.
23 24 25 |
# File 'lib/datasource.rb', line 23 def uiname @uiname end |
Instance Method Details
#processConnection ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/datasource.rb', line 39 def processConnection @connHash = '' @connection = @node.at_xpath('./connection') if !@connection.nil? then @class = @connection.attribute('class').text dsAttributes = @node.xpath('./connection/@*') dsConnStr = '' dsAttributes.each do |attr| dsConnStr += attr.text # Note: only collects non-'' attribute values end @connHash = Digest::MD5.hexdigest(dsConnStr) end end |