Class: SvnLog::Args
- Inherits:
-
SVNx::CommandArgs
- Object
- SVNx::CommandArgs
- SvnLog::Args
- Includes:
- Logue::Loggable
- Defined in:
- lib/svnx/log/args.rb
Direct Known Subclasses
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 SVNx::CommandArgs
Instance Method Summary collapse
-
#initialize(args) ⇒ Args
constructor
A new instance of Args.
- #to_a ⇒ Object
Constructor Details
#initialize(args) ⇒ Args
Returns a new instance of Args.
19 20 21 22 23 24 25 |
# File 'lib/svnx/log/args.rb', line 19 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.
14 15 16 |
# File 'lib/svnx/log/args.rb', line 14 def limit @limit end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
16 17 18 |
# File 'lib/svnx/log/args.rb', line 16 def revision @revision end |
#use_cache ⇒ Object (readonly)
Returns the value of attribute use_cache.
17 18 19 |
# File 'lib/svnx/log/args.rb', line 17 def use_cache @use_cache end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
15 16 17 |
# File 'lib/svnx/log/args.rb', line 15 def verbose @verbose end |
Instance Method Details
#to_a ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/svnx/log/args.rb', line 27 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 |