class OHDrive

Attributes

avoid[RW]

The /drives/<uuid>/info location returns a hash which looks like this as of API v?? on Fri Feb 6 01:40:45 UTC 2015

It appears the only required parameters are :name and :size, :drive is the UUID and automatically assigned

{“drive”=>“e173e5a2-d8ff-4e82-9365-5f5aec240add”, “encryption:cipher”=>“aes-xts-plain”, “name”=>“teamnerds.cool (diaspora fun) (backup)”, “size”=>17179869184, “status”=>“active”, “tier”=>“disk”, “user”=>“e179a513-5a36-4ffa-92a2-bbdc497ecd21”}

claim_type[RW]

The /drives/<uuid>/info location returns a hash which looks like this as of API v?? on Fri Feb 6 01:40:45 UTC 2015

It appears the only required parameters are :name and :size, :drive is the UUID and automatically assigned

{“drive”=>“e173e5a2-d8ff-4e82-9365-5f5aec240add”, “encryption:cipher”=>“aes-xts-plain”, “name”=>“teamnerds.cool (diaspora fun) (backup)”, “size”=>17179869184, “status”=>“active”, “tier”=>“disk”, “user”=>“e179a513-5a36-4ffa-92a2-bbdc497ecd21”}

ctags[RW]

The /drives/<uuid>/info location returns a hash which looks like this as of API v?? on Fri Feb 6 01:40:45 UTC 2015

It appears the only required parameters are :name and :size, :drive is the UUID and automatically assigned

{“drive”=>“e173e5a2-d8ff-4e82-9365-5f5aec240add”, “encryption:cipher”=>“aes-xts-plain”, “name”=>“teamnerds.cool (diaspora fun) (backup)”, “size”=>17179869184, “status”=>“active”, “tier”=>“disk”, “user”=>“e179a513-5a36-4ffa-92a2-bbdc497ecd21”}

encryption_cipher[RW]

The /drives/<uuid>/info location returns a hash which looks like this as of API v?? on Fri Feb 6 01:40:45 UTC 2015

It appears the only required parameters are :name and :size, :drive is the UUID and automatically assigned

{“drive”=>“e173e5a2-d8ff-4e82-9365-5f5aec240add”, “encryption:cipher”=>“aes-xts-plain”, “name”=>“teamnerds.cool (diaspora fun) (backup)”, “size”=>17179869184, “status”=>“active”, “tier”=>“disk”, “user”=>“e179a513-5a36-4ffa-92a2-bbdc497ecd21”}

name[RW]

The /drives/<uuid>/info location returns a hash which looks like this as of API v?? on Fri Feb 6 01:40:45 UTC 2015

It appears the only required parameters are :name and :size, :drive is the UUID and automatically assigned

{“drive”=>“e173e5a2-d8ff-4e82-9365-5f5aec240add”, “encryption:cipher”=>“aes-xts-plain”, “name”=>“teamnerds.cool (diaspora fun) (backup)”, “size”=>17179869184, “status”=>“active”, “tier”=>“disk”, “user”=>“e179a513-5a36-4ffa-92a2-bbdc497ecd21”}

readers[RW]

The /drives/<uuid>/info location returns a hash which looks like this as of API v?? on Fri Feb 6 01:40:45 UTC 2015

It appears the only required parameters are :name and :size, :drive is the UUID and automatically assigned

{“drive”=>“e173e5a2-d8ff-4e82-9365-5f5aec240add”, “encryption:cipher”=>“aes-xts-plain”, “name”=>“teamnerds.cool (diaspora fun) (backup)”, “size”=>17179869184, “status”=>“active”, “tier”=>“disk”, “user”=>“e179a513-5a36-4ffa-92a2-bbdc497ecd21”}

size[RW]

The /drives/<uuid>/info location returns a hash which looks like this as of API v?? on Fri Feb 6 01:40:45 UTC 2015

It appears the only required parameters are :name and :size, :drive is the UUID and automatically assigned

{“drive”=>“e173e5a2-d8ff-4e82-9365-5f5aec240add”, “encryption:cipher”=>“aes-xts-plain”, “name”=>“teamnerds.cool (diaspora fun) (backup)”, “size”=>17179869184, “status”=>“active”, “tier”=>“disk”, “user”=>“e179a513-5a36-4ffa-92a2-bbdc497ecd21”}

user[RW]

The /drives/<uuid>/info location returns a hash which looks like this as of API v?? on Fri Feb 6 01:40:45 UTC 2015

It appears the only required parameters are :name and :size, :drive is the UUID and automatically assigned

{“drive”=>“e173e5a2-d8ff-4e82-9365-5f5aec240add”, “encryption:cipher”=>“aes-xts-plain”, “name”=>“teamnerds.cool (diaspora fun) (backup)”, “size”=>17179869184, “status”=>“active”, “tier”=>“disk”, “user”=>“e179a513-5a36-4ffa-92a2-bbdc497ecd21”}

Public Class Methods

from_json(o) click to toggle source
# File lib/drives.rb, line 169
def self.from_json(o)
  new(options.first)
end
new(name, size="1G", *options) click to toggle source
# File lib/drives.rb, line 143
def initialize(name, size="1G", *options)
  @name = name.to_s
  @size = size.to_s
  # let's pause with the optional args for now.
  #@claim_type = options['claim:type']
  #@readers = options['readers']
  #@ctags = options['ctags']
  #@user = options['user']
  #@avoid = options['avoid']
  #@encryption_cipher = options['encryption:cipher']
  # if we only need an instance from a JSON response, we get some more attributes.
  # I need to figure out how to take raw JSON from the options hash and make this
  # object from it
  #@uuid = options['drive']
end

Public Instance Methods

to_json(*a) click to toggle source

weird little object to JSON serialization method

# File lib/drives.rb, line 160
def to_json(*a)
  h = {}
  self.instance_variables.each do |i|
    n = i.to_s.delete("@")
    h[n] = self.instance_variable_get(i)
  end
  return h.to_json(*a)
end