Module: OBIX::Objects

Defined in:
lib/obix/objects.rb,
lib/obix/objects/uri.rb,
lib/obix/objects/base.rb,
lib/obix/objects/date.rb,
lib/obix/objects/feed.rb,
lib/obix/objects/list.rb,
lib/obix/objects/time.rb,
lib/obix/objects/error.rb,
lib/obix/objects/float.rb,
lib/obix/objects/object.rb,
lib/obix/objects/string.rb,
lib/obix/objects/boolean.rb,
lib/obix/objects/integer.rb,
lib/obix/objects/duration.rb,
lib/obix/objects/operation.rb,
lib/obix/objects/reference.rb,
lib/obix/objects/enumerable.rb

Defined Under Namespace

Classes: Base, Boolean, Date, Duration, Enumerable, Error, Feed, Float, Integer, List, Object, Operation, Reference, String, Time, URI, UnknownObjectError

Class Method Summary collapse

Class Method Details

.find(tag) ⇒ Object

Find an object by the given tag.

tag - A String or Symbol describing a tag.

Returns a derivative of OBIX::Objects::Base.



37
38
39
40
41
# File 'lib/obix/objects.rb', line 37

def self.find tag
  object = @objects.find do |object|
    object.new.tag.to_s == tag.to_s
  end or raise OBIX::Objects::UnknownObjectError, "Unknown element '#{tag}'"
end

.listObject

List objects.

Returns an array of OBIX::Objects::Object instances or derivatives thereof.



28
29
30
# File 'lib/obix/objects.rb', line 28

def self.list
  @objects
end