Module: OBIX
- Defined in:
- lib/obix.rb,
lib/obix/tag.rb,
lib/obix/types.rb,
lib/obix/watch.rb,
lib/obix/alarms.rb,
lib/obix/errors.rb,
lib/obix/builder.rb,
lib/obix/history.rb,
lib/obix/network.rb,
lib/obix/objects.rb,
lib/obix/version.rb,
lib/obix/types/uri.rb,
lib/obix/types/date.rb,
lib/obix/types/time.rb,
lib/obix/types/type.rb,
lib/obix/objects/uri.rb,
lib/obix/types/float.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/types/string.rb,
lib/obix/configuration.rb,
lib/obix/objects/error.rb,
lib/obix/objects/float.rb,
lib/obix/types/boolean.rb,
lib/obix/types/integer.rb,
lib/obix/objects/object.rb,
lib/obix/objects/string.rb,
lib/obix/types/duration.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
Modules: Configuration, Network, Objects, Tag, Types Classes: Alarms, BadURIError, Builder, Error, History, PermissionError, UnsupportedError, Watch
Constant Summary collapse
- VERSION =
"0.0.1"
Class Method Summary collapse
- .configuration ⇒ Object
- .configure(&block) ⇒ Object
-
.parse(source) ⇒ Object
Parse the given source as OBIX.
Class Method Details
.configuration ⇒ Object
48 49 50 |
# File 'lib/obix.rb', line 48 def self.configuration Configuration end |
.configure(&block) ⇒ Object
52 53 54 |
# File 'lib/obix.rb', line 52 def self.configure &block Configuration.configure &block end |
.parse(source) ⇒ Object
Parse the given source as OBIX.
source - A Hash describing the source.
:string - A String describing oBIX data.
:file - A String describing a file that contains oBIX data.
:url - A String describing a URL that the oBIX data may be loaded from.
Returns an OBIX::Object instance.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/obix.rb', line 25 def self.parse source string = source[:string] url = source[:url] file = source[:file] if url string = Network.get url end if file string = File.read file end document = Nokogiri::XML.parse string do |config| config.noblanks config.strict end object = OBIX::Objects::Object.parse document.root object end |