Class: SVNx::LogCommandArgs
- Inherits:
-
CommandArgs
- Object
- CommandArgs
- SVNx::LogCommandArgs
- Includes:
- Logue::Loggable
- Defined in:
- lib/svnx/log/command.rb
Instance Attribute Summary collapse
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
-
#use_cache ⇒ Object
readonly
Returns the value of attribute use_cache.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Attributes inherited from CommandArgs
Instance Method Summary collapse
-
#initialize(args) ⇒ LogCommandArgs
constructor
A new instance of LogCommandArgs.
- #to_a ⇒ Object
Constructor Details
#initialize(args) ⇒ LogCommandArgs
Returns a new instance of LogCommandArgs.
34 35 36 37 38 39 40 |
# File 'lib/svnx/log/command.rb', line 34 def initialize args @limit = args[:limit] @verbose = args[:verbose] @use_cache = args.key?(:use_cache) ? args[:use_cache] : false @revision = args[:revision] super end |
Instance Attribute Details
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
29 30 31 |
# File 'lib/svnx/log/command.rb', line 29 def limit @limit end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
31 32 33 |
# File 'lib/svnx/log/command.rb', line 31 def revision @revision end |
#use_cache ⇒ Object (readonly)
Returns the value of attribute use_cache.
32 33 34 |
# File 'lib/svnx/log/command.rb', line 32 def use_cache @use_cache end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
30 31 32 |
# File 'lib/svnx/log/command.rb', line 30 def verbose @verbose end |
Instance Method Details
#to_a ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/svnx/log/command.rb', line 42 def to_a ary = Array.new if @limit ary << '--limit' << @limit end if @verbose ary << '-v' end if @revision [ @revision ].flatten.each do |rev| ary << "-r#{rev}" end end if @path ary << @path end ary.compact end |