Skip to content

Commit

Permalink
Parser: fixed access to target for links rendered inline of resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Feldhaus committed Sep 10, 2012
1 parent 0dbc97a commit 3bcc663
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/occi/parser.rb
Expand Up @@ -91,6 +91,7 @@ def self.header_entity(header, entity_type)
link_strings = header['HTTP_LINK'].to_s.split(',')
link_strings.each do |link_string|
link = OCCIANTLR::Parser.new('Link: ' + link_string).link
link.attributes!.occi!.core!.target = link.target
entity.links << OCCI::Core::Link.new(link.kind, link.mixins, link.attributes, link.actions, link.rel)
end
collection.resources << OCCI::Core::Resource.new(entity.kind, entity.mixins, entity.attributes, entity.links)
Expand Down Expand Up @@ -138,7 +139,7 @@ def self.text_entity(text, entity_type)
entity.source = links.first.attributes!.occi!.core!.source
collection.links << OCCI::Core::Link.new(entity.kind, entity.mixins, entity.attributes)
elsif entity_type == OCCI::Core::Resource
entity.links = links.collect { |link| OCCI::Core::Link.new(link.kind, link.mixins, link.attributes, link.actions, link.rel) }
entity.links = links.collect { |link| link.attributes!.occi!.core!.target = link.target; OCCI::Core::Link.new(link.kind, link.mixins, link.attributes, link.actions, link.rel) }
collection.resources << OCCI::Core::Resource.new(entity.kind, entity.mixins, entity.attributes, entity.links)
end unless entity.kind.nil?
collection
Expand Down

0 comments on commit 3bcc663

Please sign in to comment.