Class: CloudConnect::Notification

Inherits:
Object
  • Object
show all
Includes:
Authentication, Connection, Notification, Request
Defined in:
lib/cloud_connect/notification.rb,
lib/cloud_connect/notification/notification.rb

Defined Under Namespace

Modules: Notification

Instance Method Summary collapse

Methods included from Notification

#notification

Methods included from Request

#delete, #get, #patch, #post, #put

Methods included from Authentication

#authenticated?, #authentication

Constructor Details

#initialize(options = {}) ⇒ Notification

Returns a new instance of Notification.



12
13
14
15
16
17
# File 'lib/cloud_connect/notification.rb', line 12

def initialize(options={})
  options = CloudConnect.options.merge(options)
  Configuration::VALID_OPTIONS_KEYS.each do |key|
    send("#{key}=", options[key])
  end
end

Instance Method Details

#enhance(object, with_opts) ⇒ Object



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

def enhance(object, with_opts)
  # @private
  # Add custom methods to provided object(s).
  # This method provides syntaxic suggar upon <tt>Module.apply_to(object)</tt>,
  # allowing you to write <tt>enhance object, with: Module</tt>
  #
  # @param object [Object] An Object or Array of Objects to enhance.
  # @param with_opts [Hash] Customizable set of options.
  # @options with_opts [Module] :with Module to include.
  # @return [Object] Enhanced initial object.
  # @example Enhance an instance of Hashie::Mash with methods defined in the AssetMethods module
  #   enhance( Hashie::Mash.new, :with => AssetMethods)
  object.tap do |obj|
    with_opts[:with].apply_to(obj, client: self)
  end
end