Class: Ironment::Runcom
- Inherits:
-
Object
- Object
- Ironment::Runcom
- Defined in:
- lib/ironment/runcom.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #content ⇒ Object
- #each_pair ⇒ Object
-
#initialize(file) ⇒ Runcom
constructor
A new instance of Runcom.
- #sha1sum ⇒ Object
Constructor Details
#initialize(file) ⇒ Runcom
Returns a new instance of Runcom.
7 8 9 |
# File 'lib/ironment/runcom.rb', line 7 def initialize(file) @file = File. file end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
5 6 7 |
# File 'lib/ironment/runcom.rb', line 5 def file @file end |
Instance Method Details
#==(other) ⇒ Object
23 24 25 |
# File 'lib/ironment/runcom.rb', line 23 def ==(other) @file == other.file end |
#content ⇒ Object
27 28 29 |
# File 'lib/ironment/runcom.rb', line 27 def content @content ||= File.read(file) end |
#each_pair ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/ironment/runcom.rb', line 15 def each_pair if block_given? read_pairs.each &Proc.new else read_pairs.each end end |
#sha1sum ⇒ Object
11 12 13 |
# File 'lib/ironment/runcom.rb', line 11 def sha1sum Digest::SHA1.hexdigest(content) end |