Module: Hijiki::DcmgrResource::V1203::SecurityGroupMethods

Included in:
Hijiki::DcmgrResource::V1112::SecurityGroup, SecurityGroup
Defined in:
lib/hijiki/dcmgr_resource/12.03/security_group.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
# File 'lib/hijiki/dcmgr_resource/12.03/security_group.rb', line 4

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#to_json(options = {}) ⇒ Object

workaround for the bug:

the value of the key "rule" is encoded to JSON wrongly by
ActiveSupport::JSON encoder.
"{\"security_group\":{\"description\":\"\",\"rule\":[[null,[],null]]}}"
So it has to use the encoder from JSON library.


31
32
33
34
# File 'lib/hijiki/dcmgr_resource/12.03/security_group.rb', line 31

def to_json(options={})
  require 'json'
  {'security_group'=>@attributes}.to_json
end