Class: SVNx::LogCommandArgs
- Inherits:
-
CommandArgs
- Object
- CommandArgs
- SVNx::LogCommandArgs
- Includes:
- 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 = Hash.new) ⇒ LogCommandArgs
constructor
A new instance of LogCommandArgs.
- #to_a ⇒ Object
Constructor Details
#initialize(args = Hash.new) ⇒ LogCommandArgs
Returns a new instance of LogCommandArgs.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/svnx/log/command.rb', line 34 def initialize args = Hash.new @limit = args[:limit] @verbose = args[:verbose] @use_cache = args[:use_cache].nil? || args[:use_cache] @revision = args[:revision] info "args : #{args}" info "@limit : #{@limit}" info "@verbose : #{@verbose}" info "@use_cache: #{@use_cache}" info "@revision : #{@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
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/svnx/log/command.rb', line 47 def to_a ary = Array.new if @limit ary << '--limit' << @limit end if @verbose ary << '-v' end if @revision @revision.each do |rev| ary << "-r#{rev}" end end if @path ary << @path end ary.compact end |