Class: Flowthings::Drop

Inherits:
PlatformObjectInterface show all
Includes:
Crud::Aggregate, Crud::ExtendedMethods, Crud::Find, Crud::MemberUpdate
Defined in:
lib/flowthings/platform_objects/drop.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Crud::Aggregate

#aggregate

Methods included from Crud::MemberUpdate

#member_update

Methods included from Crud::Find

#find

Methods included from Crud::ExtendedMethods

#destroy_all, #find_many

Methods included from Crud::Base

#destroy, #read, #read_many, #update

Constructor Details

#initialize(flow_id, connection, options = {}) ⇒ Drop

Returns a new instance of Drop.



17
18
19
20
21
22
23
24
25
# File 'lib/flowthings/platform_objects/drop.rb', line 17

def initialize(flow_id, connection, options={})
  if flow_id.kind_of? Array
    @flow_ids = flow_id
  else
    @flow_id = flow_id
  end

  super connection, options
end

Instance Attribute Details

#flow_idObject

Returns the value of attribute flow_id.



15
16
17
# File 'lib/flowthings/platform_objects/drop.rb', line 15

def flow_id
  @flow_id
end

#flow_idsObject

Returns the value of attribute flow_ids.



15
16
17
# File 'lib/flowthings/platform_objects/drop.rb', line 15

def flow_ids
  @flow_ids
end

Instance Method Details

#create(data, params = {}) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/flowthings/platform_objects/drop.rb', line 27

def create(data, params={})
  if !data["path"] && !@flow_id
    raise ArgumentError.new("You either need a path in the drop data, or the Drop instance needs a flow_id")
  end

  super data, params
end