Class: ICWS::StatisticCategory

Inherits:
Object
  • Object
show all
Defined in:
lib/icws/statistics/statisticcategory.rb

Overview

Defines a category for supervisor statistics

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(propertyMap) ⇒ StatisticCategory

Creates a new Statistic category.

Parameters:

  • propertyMap (Hash)

    Map or properties that define the statistic.



17
18
19
20
21
22
23
# File 'lib/icws/statistics/statisticcategory.rb', line 17

def initialize(propertyMap)
    @statistic_category_id = propertyMap['statisticCategoryId']
    @display_string = propertyMap['displayString']
    @description = propertyMap['description']
    @statistic_definitions = []
    propertyMap['statisticDefinitions'].each {|s| @statistic_definitions.push ICWS::StatisticDefinition.new(s)}
end

Instance Attribute Details

#descriptionObject (readonly)

Category Description



11
12
13
# File 'lib/icws/statistics/statisticcategory.rb', line 11

def description
  @description
end

#display_stringObject (readonly)

Category display string



9
10
11
# File 'lib/icws/statistics/statisticcategory.rb', line 9

def display_string
  @display_string
end

#statistic_category_idObject (readonly)

Category Id



7
8
9
# File 'lib/icws/statistics/statisticcategory.rb', line 7

def statistic_category_id
  @statistic_category_id
end

#statistic_definitionsObject (readonly)

List of StatisticDefinition



13
14
15
# File 'lib/icws/statistics/statisticcategory.rb', line 13

def statistic_definitions
  @statistic_definitions
end

Instance Method Details

#to_sObject

String reporesentation - DisplayString (Category Id)



26
27
28
# File 'lib/icws/statistics/statisticcategory.rb', line 26

def to_s
    @display_string + '(' + @statistic_category_id + ')'
end