Class: Nanowrimo::Genre

Inherits:
Core
  • Object
show all
Defined in:
lib/nanowrimo/genre.rb

Overview

Handles Nanowrimo Genre data.

Constant Summary collapse

FIELDS =

fields expected from the main Genre WCAPI

%w[gid gname genre_wordcount max min stddev average count]
HISTORY_FIELDS =

fields expected from the Genre history WCAPI

%w[wc wcdate max min stddev average count]

Instance Attribute Summary collapse

Attributes inherited from Core

#error

Instance Method Summary collapse

Methods inherited from Core

#has_error?, #load, #load_history

Constructor Details

#initialize(gid) ⇒ Genre

creates a new Genre object



13
14
15
# File 'lib/nanowrimo/genre.rb', line 13

def initialize(gid)
  @gid = gid
end

Instance Attribute Details

#historyObject

Returns the value of attribute history.



11
12
13
# File 'lib/nanowrimo/genre.rb', line 11

def history
  @history
end

Instance Method Details

#idObject

converts the WCAPI unique identifier for this type into a Nanowrimo::Core-friendly ‘id’



18
19
20
# File 'lib/nanowrimo/genre.rb', line 18

def id
  @gid
end

#load_fieldObject

converts the WCAPI path for this type into something Nanowrimo::Core-friendly



23
24
25
# File 'lib/nanowrimo/genre.rb', line 23

def load_field
  'wcgenre'
end

#load_history_fieldObject

converts the WCAPI history path for this type into something Nanowrimo::Core-friendly



28
29
30
# File 'lib/nanowrimo/genre.rb', line 28

def load_history_field
  'wcgenrehist/wordcounts/wcentry'
end