Method: AppleNews::Animation#factory

Defined in:
lib/apple-news/animation.rb

#factory(data) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/apple-news/animation.rb', line 8

def factory(data)
  return if data.nil?
  
  animations.each do |animation|
    if animation.type == data[:type]
      return animation.new(data)
    end
  end

  nil
end