Class: Occi::Core::Mixins

Inherits:
Categories show all
Defined in:
lib/occi/core/mixins.rb

Instance Attribute Summary

Attributes inherited from Categories

#model

Instance Method Summary collapse

Methods inherited from Categories

#<<, #as_json, #get_related_to, #initialize, #join

Methods included from Helpers::Inspect

#inspect

Constructor Details

This class inherits a constructor from Occi::Core::Categories

Instance Method Details

#convert(category) ⇒ Object (private)


7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/occi/core/mixins.rb', line 7

def convert(category)
  category = super category

  if category.kind_of? String
    scheme, term = category.split '#'
    scheme       += '#'

    klass    = Occi::Core::Category.get_class scheme, term, [Occi::Core::Mixin.new]
    category = klass.new(scheme, term)
  end
  category
end