diff --git a/plugins/subscription/text.rb b/plugins/subscription/text.rb index 6510bd9..939590f 100644 --- a/plugins/subscription/text.rb +++ b/plugins/subscription/text.rb @@ -1,32 +1,22 @@ # -*- coding: utf-8 -*- # Name:: Automatic::Plugin::Subscription::Text # Author:: soramugi -# Created:: May 6, 2013 -# Updated:: May 6, 2013 -# Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers. +# 774 +# Created:: May 6, 2013 +# Updated:: Feb 19, 2014 +# Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers. # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0. module Automatic::Plugin class TextFeed - def initialize - @link = 'http://dummy' - @title = 'dummy' - end - - def link - @link - end - - def title - @title - end + attr_accessor :title, :link, :description, :author, :comments - def set_link(link) - @link = link - end - - def set_title(title) - @title = title + def initialize + @link = 'http://dummy' + @title = 'dummy' + @description = '' + @author = '' + @comments = '' end end @@ -41,7 +31,7 @@ def initialize(config, pipeline=[]) unless @config['titles'].nil? @config['titles'].each {|title| textFeed = TextFeed.new - textFeed.set_title(title) + textFeed.title = title @dummyfeeds << textFeed } end @@ -49,7 +39,7 @@ def initialize(config, pipeline=[]) unless @config['urls'].nil? @config['urls'].each {|url| textFeed = TextFeed.new - textFeed.set_link(url) + textFeed.link = url @dummyfeeds << textFeed } end @@ -57,13 +47,16 @@ def initialize(config, pipeline=[]) unless @config['feeds'].nil? @config['feeds'].each {|feed| textFeed = TextFeed.new - textFeed.set_title(feed['title']) unless feed['title'].nil? - textFeed.set_link(feed['url']) unless feed['url'].nil? + textFeed.title = feed['title'] unless feed['title'].nil? + textFeed.link = feed['url'] unless feed['url'].nil? + textFeed.description = feed['description'] unless feed['description'].nil? + textFeed.author = feed['author'] unless feed['author'].nil? + textFeed.comments = feed['comments'] unless feed['comments'].nil? @dummyfeeds << textFeed } end - end + end end def run