class Conjur::CLI::Complete::Resource

Attributes

account[R]
include_account[RW]
kind[R]
name[R]

Public Class Methods

new(resource_string, include_account=false) click to toggle source
# File lib/conjur/complete.rb, line 248
def initialize resource_string, include_account=false
  @include_account = include_account
  fields = resource_string.split ':'
  raise ArgumentError.new "too many fields (#{resource_string})" if fields.length > 3
  fields.unshift nil while fields.length < 3
  @account, @kind, @name = fields
end

Public Instance Methods

to_ary() click to toggle source
# File lib/conjur/complete.rb, line 256
def to_ary
  [(@account if @include_account), @kind, @name].reject { |a| a.nil? }
end
to_s() click to toggle source
# File lib/conjur/complete.rb, line 260
def to_s
  to_ary.join ':'
end