Sha256: 32ecc161b2a210dcb897894998c9eec0b27b1b8f77869e354e2c3fc7d1fc16e9

Contents?: true

Size: 551 Bytes

Versions: 3

Compression:

Stored size: 551 Bytes

Contents

module PushToSNS
  class Configuration
    PROC_PROPERTIES = %i(
      read_device_id
      read_source
      read_endpoint_arn
      read_platform_arn
      read_ios_apns
      save_endpoint_arn
    )

    PushToSNS::Configuration::PROC_PROPERTIES.each do |method_name|
      attr_accessor :"#{method_name}_proc"

      define_method(method_name) do |&block|
        public_send(:"#{method_name}_proc=", block)
      end
    end

    def apply(proc_property, *arguments)
      public_send(:"#{proc_property}_proc").call(*arguments)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
push_to_sns-0.2.0 lib/push_to_sns/configuration.rb
push_to_sns-0.1.1 lib/push_to_sns/configuration.rb
push_to_sns-0.1.0 lib/push_to_sns/configuration.rb