Class: Persistent::Shell::Command
- Inherits:
-
Struct
- Object
- Struct
- Persistent::Shell::Command
- Defined in:
- lib/persistent-shell-history/command.rb
Instance Attribute Summary collapse
-
#cmd ⇒ Object
Returns the value of attribute cmd.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
Instance Attribute Details
#cmd ⇒ Object
Returns the value of attribute cmd
7 8 9 |
# File 'lib/persistent-shell-history/command.rb', line 7 def cmd @cmd end |
#time ⇒ Object
Returns the value of attribute time
7 8 9 |
# File 'lib/persistent-shell-history/command.rb', line 7 def time @time end |
Instance Method Details
#md5 ⇒ Object
8 9 10 |
# File 'lib/persistent-shell-history/command.rb', line 8 def md5 Digest::MD5.hexdigest(cmd) end |
#to_h ⇒ Object
11 12 13 |
# File 'lib/persistent-shell-history/command.rb', line 11 def to_h { :cmd => cmd, :time => time, } end |
#to_json(*a) ⇒ Object
14 15 16 |
# File 'lib/persistent-shell-history/command.rb', line 14 def to_json(*a) to_h.to_json(*a) end |