Class: Seymour::Feed

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner) ⇒ Feed

Returns a new instance of Feed.



33
34
35
# File 'lib/seymour/feed.rb', line 33

def initialize(owner)
  @owner = owner
end

Instance Attribute Details

#ownerObject

Returns the value of attribute owner.



4
5
6
# File 'lib/seymour/feed.rb', line 4

def owner
  @owner
end

Class Method Details

.distribute(activity) ⇒ Object



12
13
14
# File 'lib/seymour/feed.rb', line 12

def distribute(activity)
  activity.distribute
end

.feed_classesObject



20
21
22
# File 'lib/seymour/feed.rb', line 20

def feed_classes
  @@feed_classes ||= []
end

.inherited(subclass) ⇒ Object



16
17
18
# File 'lib/seymour/feed.rb', line 16

def inherited(subclass)
  feed_classes << subclass
end

.key(&block) ⇒ Object



8
9
10
# File 'lib/seymour/feed.rb', line 8

def key(&block)
  define_method('key_to_store', &block)
end

.store(store_type) ⇒ Object



24
25
26
# File 'lib/seymour/feed.rb', line 24

def store(store_type)
  @store_type = "seymour/store/#{store_type}".camelize.constantize
end

.store_typeObject



28
29
30
# File 'lib/seymour/feed.rb', line 28

def store_type
  @store_type ||= Seymour::Store::List
end

Instance Method Details

#storeObject



42
43
44
# File 'lib/seymour/feed.rb', line 42

def store
  @store ||= self.class.store_type.new(key_to_store)
end