class OrgTrust
Attributes
id[R]
Public Class Methods
new(org)
click to toggle source
# File lib/satops/operator.rb, line 917 def initialize(org) @id=org['id'] @name=org['name'] @trusted_orgs=org['trusted_orgs'] end
reader(sat, org)
click to toggle source
# File lib/satops/operator.rb, line 900 def self.reader(sat, org) org_trusts=org # Misnomer - listTrusts actually returns all orgs! alltrusts=sat.orgTrusts.listTrusts(org['id']) trusts=[] alltrusts.each do |trust| if trust['trustEnabled'] trusts << trust # Broken - BZ#815715 # sat.orgTrusts.getDetails(trust['orgId']) # ... end end org_trusts.merge!({'trusted_orgs'=>trusts}) org_trusts end
Public Instance Methods
create(sat)
click to toggle source
# File lib/satops/operator.rb, line 923 def create(sat) @trusted_orgs.each do |trust| sat.orgTrusts.addTrust(@id, trust['orgId']) end end
delete(sat)
click to toggle source
# File lib/satops/operator.rb, line 929 def delete(sat) @trusted_orgs.each do |trusted| sat.orgTrusts.removeTrust(@id, trusted['orgId']) end end
update(sat)
click to toggle source
# File lib/satops/operator.rb, line 935 def update(sat) self.create(sat) end