class Pushr::ConfigurationApns
Attributes
certificate[R]
certificate_password[RW]
sandbox[RW]
skip_check_for_error[RW]
Public Instance Methods
certificate=(value)
click to toggle source
# File lib/pushr/configuration_apns.rb, line 13 def certificate=(value) if /BEGIN CERTIFICATE/.match(value) @certificate = value else # assume it's the path to the certificate and try to read it: @certificate = read_file(value) end end
name()
click to toggle source
# File lib/pushr/configuration_apns.rb, line 9 def name :apns end
to_hash()
click to toggle source
# File lib/pushr/configuration_apns.rb, line 22 def to_hash { type: self.class.to_s, app: app, enabled: enabled, connections: connections, certificate: certificate, certificate_password: certificate_password, sandbox: sandbox, skip_check_for_error: skip_check_for_error } end
Private Instance Methods
build_filename(filename)
click to toggle source
# File lib/pushr/configuration_apns.rb, line 34 def build_filename(filename) if Pathname.new(filename).absolute? filename elsif Pushr::Core.configuration_file File.join(File.dirname(Pushr::Core.configuration_file), filename) else File.join(Dir.pwd, filename) end end
read_file(filename)
click to toggle source
if filename is something wacky, this will break and raise an exception - that's OK
# File lib/pushr/configuration_apns.rb, line 30 def read_file(filename) File.read(build_filename(filename)) end