Class: Occi::Core::Action

Inherits:
Category show all
Defined in:
lib/occi/core/action.rb

Instance Attribute Summary

Attributes inherited from Category

#attributes, #model, #scheme, #term, #title

Instance Method Summary collapse

Methods inherited from Category

#as_json, categories, get_class, #location, #related_to?, #to_s, #to_string, #to_string_short, #type_identifier

Methods included from Helpers::Inspect

#inspect

Constructor Details

#initialize(scheme = 'http://schemas.ogf.org/occi/core#', term = 'action', title = nil, attributes = Occi::Core::AttributeProperties.new) ⇒ Action


9
10
11
12
13
14
# File 'lib/occi/core/action.rb', line 9

def initialize(scheme='http://schemas.ogf.org/occi/core#',
    term='action',
    title=nil,
    attributes=Occi::Core::AttributeProperties.new)
  super scheme, term, title, attributes
end

Instance Method Details

#to_headerHash


24
25
26
27
28
# File 'lib/occi/core/action.rb', line 24

def to_header
  header = super
  header["Category"] << ';attributes=' + @attributes.combine.join(' ').inspect if @attributes.any?
  header
end

#to_textString


17
18
19
20
21
# File 'lib/occi/core/action.rb', line 17

def to_text
  text = super
  text << ';attributes=' + @attributes.combine.join(' ').inspect if @attributes.any?
  text
end