Floppy-amee 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/amee/data_item.rb +3 -3
- data/lib/amee/profile_category.rb +0 -3
- data/lib/amee/version.rb +1 -1
- metadata +1 -1
    
        data/lib/amee/data_item.rb
    CHANGED
    
    | @@ -28,7 +28,7 @@ module AMEE | |
| 28 28 | 
             
                    data[:path] = doc['path']
         | 
| 29 29 | 
             
                    data[:label] = doc['dataItem']['label']
         | 
| 30 30 | 
             
                    data[:item_definition] = doc['dataItem']['itemDefinition']['uid']
         | 
| 31 | 
            -
                    data[:total_amount] = doc['amountPerMonth']
         | 
| 31 | 
            +
                    data[:total_amount] = doc['amountPerMonth'] rescue nil
         | 
| 32 32 | 
             
                    # Get values
         | 
| 33 33 | 
             
                    data[:values] = []
         | 
| 34 34 | 
             
                    doc['dataItem']['itemValues'].each do |value|
         | 
| @@ -49,7 +49,7 @@ module AMEE | |
| 49 49 | 
             
                    end
         | 
| 50 50 | 
             
                    # Create object
         | 
| 51 51 | 
             
                    Item.new(data)
         | 
| 52 | 
            -
                  rescue | 
| 52 | 
            +
                  rescue
         | 
| 53 53 | 
             
                    raise AMEE::BadData.new("Couldn't load DataItem from JSON. Check that your URL is correct.")
         | 
| 54 54 | 
             
                  end
         | 
| 55 55 |  | 
| @@ -64,7 +64,7 @@ module AMEE | |
| 64 64 | 
             
                    data[:path] = (REXML::XPath.first(doc, '/Resources/DataItemResource/Path') || REXML::XPath.first(doc, '/Resources/DataItemResource/DataItem/path')).text
         | 
| 65 65 | 
             
                    data[:label] = (REXML::XPath.first(doc, '/Resources/DataItemResource/DataItem/Label') || REXML::XPath.first(doc, '/Resources/DataItemResource/DataItem/label')).text
         | 
| 66 66 | 
             
                    data[:item_definition] = REXML::XPath.first(doc, '/Resources/DataItemResource/DataItem/ItemDefinition/@uid').to_s
         | 
| 67 | 
            -
                    data[:total_amount] = REXML::XPath.first(doc, '/Resources/DataItemResource/AmountPerMonth').text.to_f
         | 
| 67 | 
            +
                    data[:total_amount] = REXML::XPath.first(doc, '/Resources/DataItemResource/AmountPerMonth').text.to_f rescue nil
         | 
| 68 68 | 
             
                    # Get values
         | 
| 69 69 | 
             
                    data[:values] = []
         | 
| 70 70 | 
             
                    REXML::XPath.each(doc, '/Resources/DataItemResource/DataItem/ItemValues/ItemValue') do |value|
         | 
| @@ -300,9 +300,6 @@ module AMEE | |
| 300 300 | 
             
                    REXML::XPath.each(doc, '/Resources/ProfileCategoryResource/ProfileItem') do |item|
         | 
| 301 301 | 
             
                      data[:items] << parse_v2_xml_profile_item(item)
         | 
| 302 302 | 
             
                    end
         | 
| 303 | 
            -
                    REXML::XPath.each(doc, '/Resources/ProfileCategoryResource/ProfileItems/ProfileItem') do |item|
         | 
| 304 | 
            -
                      data[:items] << parse_v2_xml_profile_item(item)
         | 
| 305 | 
            -
                    end
         | 
| 306 303 | 
             
                    # Create object
         | 
| 307 304 | 
             
                    Category.new(data)
         | 
| 308 305 | 
             
                  rescue
         | 
    
        data/lib/amee/version.rb
    CHANGED