Class: Sovren::Association

Inherits:
Object
  • Object
show all
Defined in:
lib/sovren/association.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/sovren/association.rb', line 3

def name
  @name
end

#roleObject

Returns the value of attribute role.



3
4
5
# File 'lib/sovren/association.rb', line 3

def role
  @role
end

Class Method Details

.parse(associations) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/sovren/association.rb', line 5

def self.parse(associations)
  return Array.new if associations.nil?
  result = associations.css('Association').collect do |item|
    c = Association.new
    c.name = item.css('Name').first.text
    c.role = item.css('Role Name').text
    c
  end
  result
end