Class: Sovren::Patent
- Inherits:
-
Object
- Object
- Sovren::Patent
- Defined in:
- lib/sovren/patent.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#inventor_name ⇒ Object
Returns the value of attribute inventor_name.
-
#patent_id ⇒ Object
Returns the value of attribute patent_id.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/sovren/patent.rb', line 3 def description @description end |
#inventor_name ⇒ Object
Returns the value of attribute inventor_name.
3 4 5 |
# File 'lib/sovren/patent.rb', line 3 def inventor_name @inventor_name end |
#patent_id ⇒ Object
Returns the value of attribute patent_id.
3 4 5 |
# File 'lib/sovren/patent.rb', line 3 def patent_id @patent_id end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/sovren/patent.rb', line 3 def title @title end |
Class Method Details
.parse(patents) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/sovren/patent.rb', line 5 def self.parse(patents) return Array.new if patents.nil? result = patents.css('Patent').collect do |item| c = Patent.new c.title = item.css('PatentTitle').text c.description = item.css('Description').text c.inventor_name = item.css('Inventors InventorName').first.text rescue nil c.patent_id = item.css('PatentDetail PatentMilestone Id').text c end result end |