Class: Nanowrimo::Region
Overview
Handles Nanowrimo Region data.
Constant Summary collapse
- FIELDS =
fields expected from the main Region WCAPI
%w[rid rname region_wordcount max min stddev average count donations numdonors]
- HISTORY_FIELDS =
fields expected from the Region history WCAPI
%w[wc wcdate max min stddev average count donations donors]
Instance Attribute Summary collapse
-
#history ⇒ Object
Returns the value of attribute history.
Attributes inherited from Core
Instance Method Summary collapse
-
#id ⇒ Object
converts the WCAPI unique identifier for this type into a Nanowrimo::Core-friendly ‘id’.
-
#initialize(rid) ⇒ Region
constructor
creates a new Region object.
-
#load_field ⇒ Object
converts the WCAPI path for this type into something Nanowrimo::Core-friendly.
-
#load_history_field ⇒ Object
converts the WCAPI history path for this type into something Nanowrimo::Core-friendly.
Methods inherited from Core
#has_error?, #load, #load_history
Constructor Details
#initialize(rid) ⇒ Region
creates a new Region object
13 14 15 |
# File 'lib/nanowrimo/region.rb', line 13 def initialize(rid) @rid = rid end |
Instance Attribute Details
#history ⇒ Object
Returns the value of attribute history.
11 12 13 |
# File 'lib/nanowrimo/region.rb', line 11 def history @history end |
Instance Method Details
#id ⇒ Object
converts the WCAPI unique identifier for this type into a Nanowrimo::Core-friendly ‘id’
18 19 20 |
# File 'lib/nanowrimo/region.rb', line 18 def id @rid end |
#load_field ⇒ Object
converts the WCAPI path for this type into something Nanowrimo::Core-friendly
23 24 25 |
# File 'lib/nanowrimo/region.rb', line 23 def load_field 'wcregion' end |
#load_history_field ⇒ Object
converts the WCAPI history path for this type into something Nanowrimo::Core-friendly
28 29 30 |
# File 'lib/nanowrimo/region.rb', line 28 def load_history_field 'wcregionhist/wordcounts/wcentry' end |