Class: Teems::Commands::Org
- Includes:
- OrgRenderer, OrgTreeWalker
- Defined in:
- lib/teems/commands/org.rb
Overview
Show org chart for a user
Constant Summary collapse
- ORG_OPTIONS =
{ '--depth' => ->(opts, args) { opts[:depth] = parse_depth(args.shift) } }.freeze
Instance Attribute Summary
Attributes inherited from Base
#options, #positional_args, #runner
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(args, runner:) ⇒ Org
constructor
A new instance of Org.
Constructor Details
#initialize(args, runner:) ⇒ Org
Returns a new instance of Org.
141 142 143 144 |
# File 'lib/teems/commands/org.rb', line 141 def initialize(args, runner:) @options = {} super end |
Class Method Details
.parse_depth(value) ⇒ Object
134 135 136 137 138 139 |
# File 'lib/teems/commands/org.rb', line 134 def self.parse_depth(value) return 1 unless value result = value.to_i result >= 0 ? result : 1 end |
Instance Method Details
#execute ⇒ Object
146 147 148 149 150 151 152 153 154 |
# File 'lib/teems/commands/org.rb', line 146 def execute result = return result if result auth_result = require_auth return auth_result if auth_result show_org_chart end |