Sha256: 522611a3369c9350301e61e454b80a93913074c37ca9db779e978c23912343e5

Contents?: true

Size: 334 Bytes

Versions: 10

Compression:

Stored size: 334 Bytes

Contents

module Moromi::Apns::Message
  class Builder
    # @param [Hash] hash
    # @return Moromi::Apns::Message::Base
    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
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
moromi-apns-0.10.0 lib/moromi/apns/message/builder.rb
moromi-apns-0.9.0 lib/moromi/apns/message/builder.rb
moromi-apns-0.8.0 lib/moromi/apns/message/builder.rb
moromi-apns-0.7.0 lib/moromi/apns/message/builder.rb
moromi-apns-0.6.0 lib/moromi/apns/message/builder.rb
moromi-apns-0.5.0 lib/moromi/apns/message/builder.rb
moromi-apns-0.4.0 lib/moromi/apns/message/builder.rb
moromi-apns-0.3.0 lib/moromi/apns/message/builder.rb
moromi-apns-0.2.0 lib/moromi/apns/message/builder.rb
moromi-apns-0.1.0 lib/moromi/apns/message/builder.rb