Class: NSISam::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/nsisam/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Response

Returns a new instance of Response.



6
7
8
9
# File 'lib/nsisam/response.rb', line 6

def initialize(hash)
  @key, @checksum, @data, @deleted, @filename, @file = hash.values_at(
    'key', 'checksum', 'data', 'deleted', 'filename', 'file')
end

Instance Attribute Details

#checksumString

The checksum of the stored data/file

Returns:

  • (String)

    the current value of checksum



5
6
7
# File 'lib/nsisam/response.rb', line 5

def checksum
  @checksum
end

#dataHash, ...

The stored object

Returns:

  • (Hash, String, Array)

    the current value of data



5
6
7
# File 'lib/nsisam/response.rb', line 5

def data
  @data
end

#fileObject (readonly)

Returns the value of attribute file.



11
12
13
# File 'lib/nsisam/response.rb', line 11

def file
  @file
end

#filenameObject (readonly)

Returns the value of attribute filename.



11
12
13
# File 'lib/nsisam/response.rb', line 11

def filename
  @filename
end

#keyString

The key of the stored data/file

Returns:

  • (String)

    the current value of key



5
6
7
# File 'lib/nsisam/response.rb', line 5

def key
  @key
end

Instance Method Details

#deleted?Boolean

Check if some data was deleted sucessfully

Returns:

  • (Boolean)

    was the object deleted?



17
18
19
# File 'lib/nsisam/response.rb', line 17

def deleted?
  !!@deleted
end