Class: Amorail::Property::Task

Inherits:
PropertyItem show all
Defined in:
lib/amorail/property.rb

Instance Attribute Summary

Attributes inherited from PropertyItem

#data

Class Method Summary collapse

Methods inherited from PropertyItem

#[], #initialize

Methods included from MethodMissing

#method_missing

Constructor Details

This class inherits a constructor from Amorail::Property::PropertyItem

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Amorail::MethodMissing

Class Method Details

.parse(data) ⇒ Object



111
112
113
114
115
116
117
118
119
120
121
# File 'lib/amorail/property.rb', line 111

def self.parse(data)
  hash = {}
  data.fetch('task_types', []).each do |tt|
    prop_item = PropertyItem.new(tt)
    identifier = tt['code'].presence || tt['name'].presence
    next if identifier.nil?
    hash[identifier.downcase] = prop_item
    hash[identifier] = prop_item
  end
  new hash
end