Class: Nexml::DummyBase

Inherits:
Object
  • Object
show all
Defined in:
lib/nexml/nexml_parser.rb

Overview

base class for all Document objects

Direct Known Subclasses

Document, Nexml::Document::Char, Nexml::Document::Characters, Nexml::Document::Coding, Nexml::Document::Edge, Nexml::Document::Matrix, Nexml::Document::Node, Nexml::Document::Otu, Nexml::Document::Otus, Nexml::Document::State, Nexml::Document::Tree, Nexml::Document::Trees

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (DummyBase) initialize(opts)

Returns a new instance of DummyBase



88
89
90
91
92
93
94
# File 'lib/nexml/nexml_parser.rb', line 88

def initialize(opts)
  @text = nil 
  @attributes = {} 
  @attributes = opts[:attrs] if opts[:attrs] 
  @text = opts[:text] if opts[:text] 
  true 
end

Instance Attribute Details

- (Object) attributes

Returns the value of attribute attributes



87
88
89
# File 'lib/nexml/nexml_parser.rb', line 87

def attributes
  @attributes
end

- (Object) text

Returns the value of attribute text



87
88
89
# File 'lib/nexml/nexml_parser.rb', line 87

def text
  @text
end

Instance Method Details

- (Object) attribute(a)



96
97
98
# File 'lib/nexml/nexml_parser.rb', line 96

def attribute(a)
  @attributes[a]
end