the-rocci-project/rOCCI-core

View on GitHub
examples/parse_action_instance_text.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'occi/infrastructure'

Yell.new '/dev/null', name: Object

model = Occi::Infrastructure::Model.new
model.load_core!
model.load_infrastructure!

model.valid!

parser = Occi::Core::Parsers::TextParser.new(model: model, media_type: 'text/plain')
aif = File.read File.join(File.dirname(__FILE__), 'rendering', 'action_instance.txt')

ai = parser.action_instances(aif, {}).first
ai.valid!