module Conjur::DSL2::Types::ActsAsCompoundId
Public Class Methods
new(kind_or_id = nil, id_or_options = nil)
click to toggle source
# File lib/conjur/dsl2/types/records.rb, line 87 def initialize kind_or_id = nil, id_or_options = nil if kind_or_id && id_or_options && id_or_options.is_a?(String) self.kind = kind_or_id self.id = id_or_options elsif kind_or_id && kind_or_id.index(":") id_or_options ||= {} account, self.kind, self.id = kind_or_id.split(':', 3) self.account = account if account != id_or_options[:default_account] end end
Public Instance Methods
==(other)
click to toggle source
# File lib/conjur/dsl2/types/records.rb, line 98 def == other other.kind_of?(ActsAsCompoundId) && kind == other.kind && id == other.id && account == other.account end
to_s()
click to toggle source
# File lib/conjur/dsl2/types/records.rb, line 102 def to_s "#{kind} #{self.class.short_name.underscore} '#{id}'#{account && account != Conjur.configuration.account ? ' in account \'' + account + '\'': ''}" end