Class: Moromi::Apns::Message::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/moromi/apns/message/builder.rb

Class Method Summary collapse

Class Method Details

.build(hash) ⇒ Object

Returns Moromi::Apns::Message::Base.

Parameters:

  • hash (Hash)

Returns:

  • Moromi::Apns::Message::Base


5
6
7
8
9
10
11
12
13
# File 'lib/moromi/apns/message/builder.rb', line 5

def self.build(hash)
  params = hash.with_indifferent_access

  type = params[:type]
  return nil unless type.present?

  klass = type.safe_constantize
  klass.unserialize(params)
end