mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[compute|voxel] move voxel compute to its own shared area (namespacing should probably be corrected)
This commit is contained in:
parent
db2f73cec1
commit
11462e23cc
19 changed files with 12 additions and 12 deletions
40
lib/fog/voxel/parsers/compute/voxcloud_create.rb
Normal file
40
lib/fog/voxel/parsers/compute/voxcloud_create.rb
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module Compute
|
||||
module Voxel
|
||||
|
||||
class VoxcloudCreate < Fog::Parsers::Base
|
||||
|
||||
def reset
|
||||
@response = { 'device' => {} }
|
||||
end
|
||||
|
||||
def start_element(name, attrs = [])
|
||||
super
|
||||
|
||||
case name
|
||||
when 'err'
|
||||
@response['err'] = {
|
||||
'code' => attr_value('code', attrs),
|
||||
'msg' => attr_value('msg', attrs)
|
||||
}
|
||||
when 'rsp'
|
||||
@response['stat'] = attr_value('stat', attrs)
|
||||
end
|
||||
end
|
||||
|
||||
def end_element(name)
|
||||
case name
|
||||
when 'id'
|
||||
@response['device'][name] = value
|
||||
when 'last_update'
|
||||
@response['device'][name] = Time.at(value.to_i)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue