Class: Occi::Core::Action
Direct Known Subclasses
Infrastructure::Compute::Restart, Infrastructure::Compute::Start, Infrastructure::Compute::Stop, Infrastructure::Compute::Suspend, Infrastructure::Network::Down, Infrastructure::Network::Up, Infrastructure::Networkinterface::Down, Infrastructure::Networkinterface::Up, Infrastructure::Storage::Backup, Infrastructure::Storage::Offline, Infrastructure::Storage::Online, Infrastructure::Storage::Resize, Infrastructure::Storage::Snapshot, Infrastructure::Storagelink::Offline, Infrastructure::Storagelink::Online
Instance Attribute Summary
Attributes inherited from Category
#attributes, #model, #scheme, #term, #title
Instance Method Summary collapse
-
#initialize(scheme = 'http://schemas.ogf.org/occi/core#', term = 'action', title = nil, attributes = Occi::Core::Attributes.new) ⇒ Action
constructor
A new instance of Action.
-
#to_header ⇒ Hash
Hash containing the HTTP headers of the text/occi rendering.
-
#to_text ⇒ String
Text representation.
Methods inherited from Category
#as_json, categories, get_class, #inspect, #location, #related_to?, #to_s, #to_string, #to_string_short, #type_identifier
Constructor Details
#initialize(scheme = 'http://schemas.ogf.org/occi/core#', term = 'action', title = nil, attributes = Occi::Core::Attributes.new) ⇒ Action
Returns a new instance of 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::Attributes.new) super scheme, term, title, attributes end |
Instance Method Details
#to_header ⇒ Hash
Returns hash containing the HTTP headers of the text/occi rendering.
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_text ⇒ String
Returns text representation.
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 |