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.



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

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(output: $stdout) ⇒ Object



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

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