Class: Nucleo::Models::SiteFeed
- Inherits:
-
Object
- Object
- Nucleo::Models::SiteFeed
- Defined in:
- lib/nucleo/models/site_feed.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#alerts ⇒ Nucleo::Models::Feeds
Returns the Alerts as Feeds.
-
#alerts? ⇒ Boolean
Returns true if there are any alert feed items.
-
#changes ⇒ Nucleo::Models::Rules
Returns the changes as Rules.
-
#changes? ⇒ Boolean
Returns true if there are any change rules.
-
#initialize(attributes = {}) ⇒ Nucleo::Models::SiteFeed
constructor
Returns an instanc eof the Site Feed domain model.
-
#metrics ⇒ Nucleo::Models::Feeds
Returns the Metrics as Feeds.
-
#metrics? ⇒ Boolean
Returns true if there are any Metric feed items.
-
#pages ⇒ Nucleo::Models::FeedTypes::Analytics::Pages
Returns the Analytics Pages domain model.
-
#pages? ⇒ Boolean
Returns true if there is an Analytics Pages domain model.
Constructor Details
#initialize(attributes = {}) ⇒ Nucleo::Models::SiteFeed
Returns an instanc eof the Site Feed domain model
11 12 13 |
# File 'lib/nucleo/models/site_feed.rb', line 11 def initialize(attributes={}) @attributes = attributes end |
Class Method Details
Instance Method Details
#alerts ⇒ Nucleo::Models::Feeds
Returns the Alerts as Feeds
56 57 58 |
# File 'lib/nucleo/models/site_feed.rb', line 56 def alerts Nucleo::Models::Feeds.new(@attributes.fetch('alerts', [])) end |
#alerts? ⇒ Boolean
Returns true if there are any alert feed items
63 64 65 |
# File 'lib/nucleo/models/site_feed.rb', line 63 def alerts? self.alerts.any? end |
#changes ⇒ Nucleo::Models::Rules
Returns the changes as Rules
70 71 72 |
# File 'lib/nucleo/models/site_feed.rb', line 70 def changes Nucleo::Models::Rules.new(@attributes.fetch('changes', [])) end |
#changes? ⇒ Boolean
Returns true if there are any change rules
77 78 79 |
# File 'lib/nucleo/models/site_feed.rb', line 77 def changes? self.changes.any? end |
#metrics ⇒ Nucleo::Models::Feeds
Returns the Metrics as Feeds
42 43 44 |
# File 'lib/nucleo/models/site_feed.rb', line 42 def metrics Nucleo::Models::Feeds.new(@attributes.fetch('metrics', [])) end |
#metrics? ⇒ Boolean
Returns true if there are any Metric feed items
49 50 51 |
# File 'lib/nucleo/models/site_feed.rb', line 49 def metrics? self.metrics.any? end |
#pages ⇒ Nucleo::Models::FeedTypes::Analytics::Pages
Returns the Analytics Pages domain model
24 25 26 27 28 29 30 |
# File 'lib/nucleo/models/site_feed.rb', line 24 def pages if @attributes.has_key?('pages') Nucleo::Models::FeedTypes::Analytics::Site::Pages.new(@attributes.fetch('pages', {})) else nil end end |
#pages? ⇒ Boolean
Returns true if there is an Analytics Pages domain model
35 36 37 |
# File 'lib/nucleo/models/site_feed.rb', line 35 def pages? self.pages.present? end |