lib/dreamy/base.rb in dreamy-0.5.2 vs lib/dreamy/base.rb in dreamy-0.5.3
- old
+ new
@@ -88,11 +88,49 @@
}.merge(options)
doc = request("announcement_list-post_announcement", values, true)
api_error?(doc)
true
end
-
+
+ def mail_list_filters
+ doc = request("mail-list_filters")
+ api_error?(doc)
+ (doc/:data).inject([]) { |filters, filter| filters << MailFilter.new_from_xml(filter); filters }
+ end
+
+ def mail_add_filter(address,filter_on,filter,action,action_value,contains="",stop="",rank="")
+ doc = request("mail-add_filter",
+ {
+ "address" => address,
+ "filter_on" => filter_on,
+ "filter" => filter,
+ "action" => action,
+ "action_value" => action_value,
+ "contains" => contains,
+ "stop" => stop,
+ "rank" => rank
+ })
+ api_error?(doc)
+ true
+ end
+
+ def mail_remove_filter(address,filter_on,filter,action,action_value,contains,stop,rank)
+ doc = request("mail-remove_filter",
+ {
+ "address" => address,
+ "filter_on" => filter_on,
+ "filter" => filter,
+ "action" => action,
+ "action_value" => action_value,
+ "contains" => contains,
+ "stop" => stop,
+ "rank" => rank
+ })
+ api_error?(doc)
+ true
+ end
+
def mysql_dbs
doc = request("mysql-list_dbs")
api_error?(doc)
(doc/:data).inject([]) { |dbs, db| dbs << MysqlDb.new_from_xml(db); dbs }
end
@@ -229,6 +267,6 @@
def parse(response)
Hpricot.XML(response || '')
end
end
-end
\ No newline at end of file
+end