Class: Fulcrum::Record

Inherits:
Resource show all
Includes:
Actions::Create, Actions::Find, Actions::List, Actions::Update
Defined in:
lib/fulcrum/record.rb

Constant Summary

Constants included from Actions::List

Actions::List::DEFAULT_PER_PAGE

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods included from Actions::Update

#update

Methods included from Actions::Create

#create, #create_action

Methods included from Actions::Find

#find

Methods included from Actions::List

#all, #default_list_params

Methods inherited from Resource

#attributes_for_object, #call, #collection, #initialize, #member, #member_action, #resource_name, #resources_name

Constructor Details

This class inherits a constructor from Fulcrum::Resource

Instance Method Details

#delete(id, changeset_id = nil) ⇒ Object



8
9
10
11
12
13
# File 'lib/fulcrum/record.rb', line 8

def delete(id, changeset_id=nil)
  record_attributes = {}
  record_attributes[:changeset_id] = changeset_id if changeset_id

  call(:delete, member(id), attributes_for_object(record_attributes))
end

#history(id) ⇒ Object



15
16
17
18
19
# File 'lib/fulcrum/record.rb', line 15

def history(id)
  result = call(:get, member_action(id, 'history'))

  Page.new(result, resources_name)
end