Class: G5IntegrationsUpdatable::FeedProcessor
- Inherits:
-
Object
- Object
- G5IntegrationsUpdatable::FeedProcessor
- Defined in:
- lib/g5_integrations_updatable/feed_processor.rb
Instance Attribute Summary collapse
-
#feed_url ⇒ Object
Returns the value of attribute feed_url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ FeedProcessor
constructor
A new instance of FeedProcessor.
- #process ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ FeedProcessor
Returns a new instance of FeedProcessor.
5 6 7 |
# File 'lib/g5_integrations_updatable/feed_processor.rb', line 5 def initialize(params={}) self.feed_url = params[:feed_url] end |
Instance Attribute Details
#feed_url ⇒ Object
Returns the value of attribute feed_url.
3 4 5 |
# File 'lib/g5_integrations_updatable/feed_processor.rb', line 3 def feed_url @feed_url end |
Class Method Details
.find_or_create_all(feed_array) ⇒ Object
15 16 17 18 19 |
# File 'lib/g5_integrations_updatable/feed_processor.rb', line 15 def find_or_create_all(feed_array) feed_array.each do |location_setting_hash| G5IntegrationsUpdatable::LocationSetting.find_or_create_from_feed(location_setting_hash) end end |
.load_all_settings(all_uri) ⇒ Object
10 11 12 13 |
# File 'lib/g5_integrations_updatable/feed_processor.rb', line 10 def load_all_settings(all_uri) result_hash = G5IntegrationsUpdatable::FeedFetcher.new(all_uri).process find_or_create_all result_hash end |
Instance Method Details
#process ⇒ Object
22 23 24 |
# File 'lib/g5_integrations_updatable/feed_processor.rb', line 22 def process self.class.find_or_create_all feed_hash_array end |