Class: Ninny::Commands::OutputDatedBranch

Inherits:
Ninny::Command show all
Defined in:
lib/ninny/commands/output_dated_branch.rb

Direct Known Subclasses

StagingBranch

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ninny::Command

#command, #cursor, #editor, #exec_exist?, #generator, #pager, #platform, #prompt, #screen, #which

Constructor Details

#initialize(options) ⇒ OutputDatedBranch

Returns a new instance of OutputDatedBranch.



9
10
11
12
# File 'lib/ninny/commands/output_dated_branch.rb', line 9

def initialize(options)
  @branch_type = options[:branch_type] || Git::STAGING_PREFIX
  @options = options
end

Instance Attribute Details

#branch_typeObject (readonly)

Returns the value of attribute branch_type.



8
9
10
# File 'lib/ninny/commands/output_dated_branch.rb', line 8

def branch_type
  @branch_type
end

Instance Method Details

#execute(input: $stdin, output: $stdout) ⇒ Object



14
15
16
# File 'lib/ninny/commands/output_dated_branch.rb', line 14

def execute(input: $stdin, output: $stdout)
  output.puts Ninny.git.latest_branch_for(branch_type)
end