class Nucleo::Models::SiteFeed
Public Class Methods
new(attributes={})
click to toggle source
Returns an instanc eof the Site Feed
domain model
@param attributes [Hash]
@return [Nucleo::Models::SiteFeed]
# File lib/nucleo/models/site_feed.rb, line 11 def initialize(attributes={}) @attributes = attributes end
retrieve(id, params={})
click to toggle source
# File lib/nucleo/models/site_feed.rb, line 15 def self.retrieve(id, params={}) response_body = Nucleo::Requests::SiteFeed.retrieve(id, params) self.new(response_body) end
Public Instance Methods
alerts()
click to toggle source
Returns the Alerts as Feeds
@return [Nucleo::Models::Feeds]
# File lib/nucleo/models/site_feed.rb, line 56 def alerts Nucleo::Models::Feeds.new(@attributes.fetch('alerts', [])) end
alerts?()
click to toggle source
Returns true if there are any alert feed items
@return [Boolean]
# File lib/nucleo/models/site_feed.rb, line 63 def alerts? self.alerts.any? end
changes()
click to toggle source
Returns the changes as Rules
@return [Nucleo::Models::Rules]
# File lib/nucleo/models/site_feed.rb, line 70 def changes Nucleo::Models::Rules.new(@attributes.fetch('changes', [])) end
changes?()
click to toggle source
Returns true if there are any change rules
@return [Boolean]
# File lib/nucleo/models/site_feed.rb, line 77 def changes? self.changes.any? end
metrics()
click to toggle source
Returns the Metrics as Feeds
@return [Nucleo::Models::Feeds]
# File lib/nucleo/models/site_feed.rb, line 42 def metrics Nucleo::Models::Feeds.new(@attributes.fetch('metrics', [])) end
metrics?()
click to toggle source
Returns true if there are any Metric
feed items
@return [Boolean]
# File lib/nucleo/models/site_feed.rb, line 49 def metrics? self.metrics.any? end
pages()
click to toggle source
Returns the Analytics Pages
domain model
@return [Nucleo::Models::FeedTypes::Analytics::Pages]
# 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?()
click to toggle source
Returns true if there is an Analytics Pages
domain model
@return [Boolean]
# File lib/nucleo/models/site_feed.rb, line 35 def pages? self.pages.present? end