Class: NewsFireExport::Group

Inherits:
Object
  • Object
show all
Defined in:
lib/newsfire_export.rb

Constant Summary collapse

@@num_untitled =
0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash, feedlist) ⇒ Group

Returns a new instance of Group.



89
90
91
92
93
94
95
96
97
# File 'lib/newsfire_export.rb', line 89

def initialize hash,feedlist
  @name=hash['name']
  @name="Untitled group #{@@num_untitled+=1}" if @name.nil?
  @feedlist=feedlist
  @feeds = Hash.new
  hash['conditionsArray'].each do |feed| 
    @feeds[feed['friendlyFileName']]=nil
  end
end

Instance Attribute Details

#feedsObject

Returns the value of attribute feeds.



87
88
89
# File 'lib/newsfire_export.rb', line 87

def feeds
  @feeds
end

#nameObject (readonly)

Returns the value of attribute name.



87
88
89
# File 'lib/newsfire_export.rb', line 87

def name
  @name
end

Instance Method Details

#add_feed(feed) ⇒ Object



98
99
# File 'lib/newsfire_export.rb', line 98

def add_feed feed
end

#to_sObject



100
101
102
103
# File 'lib/newsfire_export.rb', line 100

def to_s
  return "" if @feedlist.filter and @name=~/^_/
  to_opml
end