Class: FileDownload

Inherits:
Download show all
Defined in:
lib/wonko_the_sane/wonko_version.rb

Instance Attribute Summary collapse

Attributes inherited from Download

#internalUrl, #rules, #sha256, #size, #url

Instance Method Summary collapse

Methods inherited from Download

from_json, #type

Constructor Details

#initialize(url = nil, destination = nil) ⇒ FileDownload

Returns a new instance of FileDownload.



48
49
50
51
# File 'lib/wonko_the_sane/wonko_version.rb', line 48

def initialize(url = nil, destination = nil)
  @url = url
  @destination = destination
end

Instance Attribute Details

#destinationObject

Returns the value of attribute destination.



46
47
48
# File 'lib/wonko_the_sane/wonko_version.rb', line 46

def destination
  @destination
end

Instance Method Details

#from_json(json) ⇒ Object



59
60
61
62
# File 'lib/wonko_the_sane/wonko_version.rb', line 59

def from_json(json)
  super
  @destination = json[:destination]
end

#to_jsonObject



53
54
55
56
57
# File 'lib/wonko_the_sane/wonko_version.rb', line 53

def to_json
  obj = super
  obj[:destination] = @destination
  obj
end