Class: FlapjackConfigurator::FlapjackMedia

Inherits:
FlapjackSubObjectBase show all
Defined in:
lib/flapjack_configurator/flapjack_media.rb

Overview

Class representing Flapjack media

Instance Attribute Summary

Attributes inherited from FlapjackObjectBase

#config, #obj_exists

Instance Method Summary collapse

Methods inherited from FlapjackSubObjectBase

#_create, #_filter_config, #update

Methods inherited from FlapjackObjectBase

#_load_from_api, #_reload_config, #_update, #delete, #id

Constructor Details

#initialize(current_config, diner, logger) ⇒ FlapjackMedia

Returns a new instance of FlapjackMedia.



8
9
10
11
# File 'lib/flapjack_configurator/flapjack_media.rb', line 8

def initialize(current_config, diner, logger)
  super(nil, current_config, diner.method(:media), diner.method(:create_contact_media), diner.method(:update_media), diner.method(:delete_media), logger, 'media')
  @allowed_config_keys = [:address, :interval, :rollup_threshold]
end

Instance Method Details

#create(contact_id, type, config) ⇒ Object

Create a new entry



14
15
16
# File 'lib/flapjack_configurator/flapjack_media.rb', line 14

def create(contact_id, type, config)
  _create(contact_id, _filter_config(config).merge(type: type))
end

#typeObject

Helper to return the type



19
20
21
# File 'lib/flapjack_configurator/flapjack_media.rb', line 19

def type
  return @config[:type]
end