Module: CloudConnect::Notification::Notification

Included in:
CloudConnect::Notification
Defined in:
lib/cloud_connect/notification/notification.rb

Defined Under Namespace

Modules: NotificationMethods

Instance Method Summary collapse

Instance Method Details

#notification(json) ⇒ Array Also known as: list_notification

Notification

@client.notification(json)

Examples:

Notification

Parameters:

  • json (String)

    JSON of the POST request

Returns:

  • (Array)

    The fields from the json, deserialized and decoded

See Also:



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/cloud_connect/notification/notification.rb', line 18

def notification(json)
  result = connection(false, false)
  json = JSON.parse(json)
  if json.class == [].class
    mash = []
    json.each do |obj|
      mash << Hashie::Mash.new(obj)
    end
  else
    mash = Hashie::Mash.new(json)
  end
  return parse_notification(mash)
end