Class: ActBlue::Page

Inherits:
ActiveBlue show all
Defined in:
lib/actblue/page.rb

Constant Summary collapse

XML_NAME =
'page'
ATTRIBUTES =
['name', 'partner', 'created-on']
ELEMENTS =
['title', 'author', 'blurb', 'visibility', 'showcandidatesummary', 'listentries']

Constants inherited from ActiveBlue

ActiveBlue::ACT_TYPES

Instance Attribute Summary

Attributes inherited from ActiveBlue

#variables

Instance Method Summary collapse

Methods inherited from ActiveBlue

#[], #[]=, #initialize, #to_xml, #to_xml_element

Constructor Details

This class inherits a constructor from ActBlue::ActiveBlue

Instance Method Details

#deleteObject



17
18
19
20
# File 'lib/actblue/page.rb', line 17

def delete
  @variables['visibility'] = "archived"
  ActiveBlue.put("/pages/#{@variables['name']}", :body => to_xml) if @variables['name']
end

#postObject



9
10
11
# File 'lib/actblue/page.rb', line 9

def post
  ActiveBlue.post('/pages', :body => to_xml)
end

#putObject



13
14
15
# File 'lib/actblue/page.rb', line 13

def put
  ActiveBlue.put("/pages/#{@variables['name']}", :body => to_xml) if @variables['name']
end