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.



259
260
261
262
263
# File 'lib/dorothy2/DEM.rb', line 259

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.



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

def cont
  @cont
end

#dateObject (readonly)

Returns the value of attribute date.



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

def date
  @date
end

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

#sha2Object

Returns the value of attribute sha2.



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

def sha2
  @sha2
end

#sizeObject

Returns the value of attribute size.



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

def size
  @size
end

Class Method Details

.sha2(content) ⇒ Object



265
266
267
268
# File 'lib/dorothy2/DEM.rb', line 265

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