Class: Google::Storage::Data::BucketAcl
- Inherits:
-
Object
- Object
- Google::Storage::Data::BucketAcl
- Includes:
- Comparable
- Defined in:
- lib/google/storage/property/bucket_acl.rb
Overview
A class to manage data for Acl for bucket.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#bucket ⇒ Object
readonly
Returns the value of attribute bucket.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#entity ⇒ Object
readonly
Returns the value of attribute entity.
-
#entity_id ⇒ Object
readonly
Returns the value of attribute entity_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#project_team ⇒ Object
readonly
Returns the value of attribute project_team.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
Instance Attribute Details
#bucket ⇒ Object (readonly)
Returns the value of attribute bucket.
38 39 40 |
# File 'lib/google/storage/property/bucket_acl.rb', line 38 def bucket @bucket end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
39 40 41 |
# File 'lib/google/storage/property/bucket_acl.rb', line 39 def domain @domain end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
40 41 42 |
# File 'lib/google/storage/property/bucket_acl.rb', line 40 def email @email end |
#entity ⇒ Object (readonly)
Returns the value of attribute entity.
41 42 43 |
# File 'lib/google/storage/property/bucket_acl.rb', line 41 def entity @entity end |
#entity_id ⇒ Object (readonly)
Returns the value of attribute entity_id.
42 43 44 |
# File 'lib/google/storage/property/bucket_acl.rb', line 42 def entity_id @entity_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
43 44 45 |
# File 'lib/google/storage/property/bucket_acl.rb', line 43 def id @id end |
#project_team ⇒ Object (readonly)
Returns the value of attribute project_team.
44 45 46 |
# File 'lib/google/storage/property/bucket_acl.rb', line 44 def project_team @project_team end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
45 46 47 |
# File 'lib/google/storage/property/bucket_acl.rb', line 45 def role @role end |
Instance Method Details
#<=>(other) ⇒ Object
82 83 84 85 86 87 88 89 90 |
# File 'lib/google/storage/property/bucket_acl.rb', line 82 def <=>(other) return false unless other.is_a? BucketAcl compare_fields(other).each do |compare| next if compare[:self].nil? || compare[:other].nil? result = compare[:self] <=> compare[:other] return result unless result.zero? end 0 end |
#==(other) ⇒ Object
73 74 75 76 77 78 79 80 |
# File 'lib/google/storage/property/bucket_acl.rb', line 73 def ==(other) return false unless other.is_a? BucketAcl compare_fields(other).each do |compare| next if compare[:self].nil? || compare[:other].nil? return false if compare[:self] != compare[:other] end true end |
#to_json(_arg = nil) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/google/storage/property/bucket_acl.rb', line 47 def to_json(_arg = nil) { 'bucket' => bucket, 'domain' => domain, 'email' => email, 'entity' => entity, 'entityId' => entity_id, 'id' => id, 'projectTeam' => project_team, 'role' => role }.reject { |_k, v| v.nil? }.to_json end |
#to_s ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/google/storage/property/bucket_acl.rb', line 60 def to_s { bucket: bucket, domain: domain, email: email, entity: entity, entity_id: entity_id, id: id, project_team: project_team, role: role }.reject { |_k, v| v.nil? }.map { |k, v| "#{k}: #{v}" }.join(', ') end |