Class: OpenWFE::Extras::BlogParticipant
- Inherits:
-
AtomPubParticipant
- Object
- AtomPubParticipant
- OpenWFE::Extras::BlogParticipant
- Includes:
- TemplateMixin
- Defined in:
- lib/openwfe/extras/participants/atompub_participants.rb
Overview
A participant that blogs.
require 'openwfe/extras/participants/atompub_participants'
include OpenWFE::Extras
target_uri = "https://openwferu.wordpress.com/wp-app.php/posts"
params = {}
params[:username] = 'jeff'
params[:password] = 'whatever'
params[:categories] = 'openwferu, test'
#params[:title_field] = "title"
#
# which workitem field will hold the post title ?
# by default, it's "title"
engine.register_participant "blogger", BlogParticipant.new(target_uri, params) do
"""
paragraph 0
paragraph 1 : ${f:message}
paragraph 2
"""
end
This participant takes its template and the workitem it receives to publish a blog entry.
The template can be specified as a block (as in the previous example) or via the :template parameter.
Instance Attribute Summary
Attributes inherited from AtomPubParticipant
#author_name, #author_uri, #target_uri
Instance Method Summary collapse
-
#initialize(target_uri, params, &block) ⇒ BlogParticipant
constructor
A new instance of BlogParticipant.
Methods inherited from AtomPubParticipant
Constructor Details
#initialize(target_uri, params, &block) ⇒ BlogParticipant
Returns a new instance of BlogParticipant.
245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/openwfe/extras/participants/atompub_participants.rb', line 245 def initialize (target_uri, params, &block) super @template = params[:template] @block_template = block @content_type = params[:content_type] || "html" @title_field = params[:title_field] || "title" end |