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.



257
258
259
260
261
# File 'lib/dorothy2/DEM.rb', line 257

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.



252
253
254
# File 'lib/dorothy2/DEM.rb', line 252

def cont
  @cont
end

#dateObject (readonly)

Returns the value of attribute date.



254
255
256
# File 'lib/dorothy2/DEM.rb', line 254

def date
  @date
end

#pathObject (readonly)

Returns the value of attribute path.



253
254
255
# File 'lib/dorothy2/DEM.rb', line 253

def path
  @path
end

#sha2Object

Returns the value of attribute sha2.



251
252
253
# File 'lib/dorothy2/DEM.rb', line 251

def sha2
  @sha2
end

#sizeObject

Returns the value of attribute size.



255
256
257
# File 'lib/dorothy2/DEM.rb', line 255

def size
  @size
end

Class Method Details

.sha2(content) ⇒ Object



263
264
265
266
# File 'lib/dorothy2/DEM.rb', line 263

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