Exception: Pubnub::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/pubnub/error.rb

Overview

Some custom pubnub errors

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env = {}) ⇒ Error

Returns a new instance of Error.



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/pubnub/error.rb', line 7

def initialize(env = {})
  unless env.instance_of? Hash
    fail ::ArgumentError, 'Env passed to Pubnub::Error must be a hash'
  end

  @env = env
  @message = ''

  build_message

  log_error
end

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env.



5
6
7
# File 'lib/pubnub/error.rb', line 5

def env
  @env
end

#messageObject (readonly)

Returns the value of attribute message.



5
6
7
# File 'lib/pubnub/error.rb', line 5

def message
  @message
end