Class: Pushr::ConfigurationApns2

Inherits:
Configuration
  • Object
show all
Defined in:
lib/pushr/configuration_apns2.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#key_idObject

Returns the value of attribute key_id.



3
4
5
# File 'lib/pushr/configuration_apns2.rb', line 3

def key_id
  @key_id
end

#private_keyObject

Returns the value of attribute private_key.



3
4
5
# File 'lib/pushr/configuration_apns2.rb', line 3

def private_key
  @private_key
end

#sandboxObject

Returns the value of attribute sandbox.



3
4
5
# File 'lib/pushr/configuration_apns2.rb', line 3

def sandbox
  @sandbox
end

#team_idObject

Returns the value of attribute team_id.



3
4
5
# File 'lib/pushr/configuration_apns2.rb', line 3

def team_id
  @team_id
end

Instance Method Details

#certificate=(value) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/pushr/configuration_apns2.rb', line 11

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

#nameObject



7
8
9
# File 'lib/pushr/configuration_apns2.rb', line 7

def name
  :apns2
end

#to_hashObject



20
21
22
23
# File 'lib/pushr/configuration_apns2.rb', line 20

def to_hash
  { type: self.class.to_s, app: app, enabled: enabled, connections: connections, private_key: private_key,
    team_id: team_id, key_id: key_id, sandbox: sandbox }
end