Class: ICWS::Statistics
- Inherits:
-
Messages::MessageSubscriber
- Object
- Messages::MessageSubscriber
- ICWS::Statistics
- Defined in:
- lib/icws/statistics/statistics.rb
Overview
Subscribes to Statistics from CIC
Instance Attribute Summary collapse
-
#statistic_catalog ⇒ Object
readonly
Hash of Statistics catalogs.
Instance Method Summary collapse
-
#event_received(message) ⇒ Object
block for when a new stat catalog message comes in.
-
#initialize(connection, message_queue) ⇒ Statistics
constructor
Constructor which sets up a new watcher on the statistics catalog.
Constructor Details
#initialize(connection, message_queue) ⇒ Statistics
Constructor which sets up a new watcher on the statistics catalog
11 12 13 14 15 16 |
# File 'lib/icws/statistics/statistics.rb', line 11 def initialize(connection, ) super(connection, ,'urn:inin.com:statistics:statisticCatalogMessage') @client = ICWS::Client.new connection @client.put '/messaging/subscriptions/statistics/statistic-catalog', {} end |
Instance Attribute Details
#statistic_catalog ⇒ Object (readonly)
Hash of Statistics catalogs
8 9 10 |
# File 'lib/icws/statistics/statistics.rb', line 8 def statistic_catalog @statistic_catalog end |
Instance Method Details
#event_received(message) ⇒ Object
block for when a new stat catalog message comes in
19 20 21 22 23 24 25 |
# File 'lib/icws/statistics/statistics.rb', line 19 def event_received() if ['__type'] == 'urn:inin.com:statistics:statisticCatalogMessage' @statistic_catalog = [] ['statisticCategoryList'].each {|s| @statistic_catalog.push ICWS::StatisticCategory.new(s)} end end |