Class: Seymour::Feed
- Inherits:
-
Object
- Object
- Seymour::Feed
- Defined in:
- lib/seymour/feed.rb
Instance Attribute Summary collapse
-
#owner ⇒ Object
Returns the value of attribute owner.
Class Method Summary collapse
- .distribute(activity) ⇒ Object
- .feed_classes ⇒ Object
- .inherited(subclass) ⇒ Object
- .key(&block) ⇒ Object
- .store(store_type) ⇒ Object
- .store_type ⇒ Object
Instance Method Summary collapse
-
#initialize(owner) ⇒ Feed
constructor
A new instance of Feed.
- #store ⇒ Object
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
#owner ⇒ Object
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_classes ⇒ Object
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 |
Instance Method Details
#store ⇒ Object
42 43 44 |
# File 'lib/seymour/feed.rb', line 42 def store @store ||= self.class.store_type.new(key_to_store) end |