Class: NexusParser::NexusParser::Character
- Inherits:
-
Object
- Object
- NexusParser::NexusParser::Character
- Defined in:
- lib/nexus_parser.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#states ⇒ Object
Returns the value of attribute states.
Instance Method Summary collapse
-
#add_state(options = {}) ⇒ Object
requires :label.
-
#initialize ⇒ Character
constructor
A new instance of Character.
-
#state_labels ⇒ Object
test this.
Constructor Details
#initialize ⇒ Character
Returns a new instance of Character.
30 31 32 33 34 |
# File 'lib/nexus_parser.rb', line 30 def initialize @name = nil @states = {} @notes = [] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
29 30 31 |
# File 'lib/nexus_parser.rb', line 29 def name @name end |
#notes ⇒ Object
Returns the value of attribute notes.
29 30 31 |
# File 'lib/nexus_parser.rb', line 29 def notes @notes end |
#states ⇒ Object
Returns the value of attribute states.
29 30 31 |
# File 'lib/nexus_parser.rb', line 29 def states @states end |
Instance Method Details
#add_state(options = {}) ⇒ Object
requires :label
37 38 39 40 41 42 43 44 |
# File 'lib/nexus_parser.rb', line 37 def add_state( = {}) @opt = { :name => '' }.merge!() return false if !@opt[:label] @states.update(@opt[:label] => ChrState.new(@opt[:name])) end |
#state_labels ⇒ Object
test this
47 48 49 |
# File 'lib/nexus_parser.rb', line 47 def state_labels @states.keys.sort end |