Class: ApraService::NotificationResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/apralib/notification_response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(notification, error) ⇒ NotificationResponse

Returns a new instance of NotificationResponse.



7
8
9
10
# File 'lib/apralib/notification_response.rb', line 7

def initialize(notification, error)
  @notification = notification
  @error = error
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



5
6
7
# File 'lib/apralib/notification_response.rb', line 5

def error
  @error
end

#notificationObject

Returns the value of attribute notification.



5
6
7
# File 'lib/apralib/notification_response.rb', line 5

def notification
  @notification
end

Class Method Details

.from_hash(hash) ⇒ Object



13
14
15
16
17
# File 'lib/apralib/notification_response.rb', line 13

def self.from_hash(hash)
  notification = Notification.from_hash(hash[:ilmoitus])
  error = hash[:virhe]
  NotificationResponse.new(notification, error)
end