Module: Bio::NeXML::Mapper

Included in:
Cell, Char, Characters, Edge, Format, Matrix, Nexml, Node, Otu, Otus, Row, Sequence, State, States, Tree, Trees
Defined in:
lib/bio/db/nexml/mapper.rb,
lib/bio/db/nexml/mapper/framework.rb,
lib/bio/db/nexml/mapper/inflection.rb,
lib/bio/db/nexml/mapper/repository.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Framework, Inflections Classes: ArrayRepository, HashRepository

Instance Method Summary collapse

Instance Method Details

#properties(args = {}) ⇒ Object Also known as: properties=

Gets or sets properties of the receiver.



70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/bio/db/nexml/mapper.rb', line 70

def properties( args = {} )
  @properties ||= {}

  # set properties if defined
  args.each do |property, value|
    raise "#{property} not defined" unless respond_to?( setter = "#{property}=" )
    send( setter, value )
  end unless args.empty?

  # return a copy of @properties so that it is not modified inadvertently by the user
  @properties.dup
end