Class: DoroParser::DoroFile

Inherits:
Object
  • Object
show all
Defined in:
lib/dorothy2/DEM.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ DoroFile

Returns a new instance of DoroFile.



330
331
332
333
334
# File 'lib/dorothy2/DEM.rb', line 330

def initialize(hash)
	repo = DoroSettings.env[:home] + "/downloads"
	@path = "#{repo}/#{hash}.exe"
	@date = Time.new.strftime("%m/%d/%y %H:%M:%S")
end

Instance Attribute Details

#contObject

Returns the value of attribute cont.



325
326
327
# File 'lib/dorothy2/DEM.rb', line 325

def cont
  @cont
end

#dateObject (readonly)

Returns the value of attribute date.



327
328
329
# File 'lib/dorothy2/DEM.rb', line 327

def date
  @date
end

#pathObject (readonly)

Returns the value of attribute path.



326
327
328
# File 'lib/dorothy2/DEM.rb', line 326

def path
  @path
end

#sha2Object

Returns the value of attribute sha2.



324
325
326
# File 'lib/dorothy2/DEM.rb', line 324

def sha2
  @sha2
end

#sizeObject

Returns the value of attribute size.



328
329
330
# File 'lib/dorothy2/DEM.rb', line 328

def size
  @size
end

Class Method Details

.sha2(content) ⇒ Object



336
337
338
339
# File 'lib/dorothy2/DEM.rb', line 336

def self.sha2(content)
	@sha2 = Digest::SHA2.new
	@sha2 << content
end