Sha256: a16b584ae4ef7e2897e04ca49280e0c3e8d8ff74845727a431bd64fd6199e2c6

Contents?: true

Size: 1.12 KB

Versions: 14

Compression:

Stored size: 1.12 KB

Contents

module Fog
  module Parsers
    module Google
      module Storage

        class AccessControlList < Fog::Parsers::Base

          def reset
            @in_entries = false
            @entry = { 'Scope' => {} }
            @response = { 'Owner' => {}, 'AccessControlList' => [] }
          end

          def start_element(name, attrs = [])
            super
            case name
            when 'Entries'
              @in_entries = true
            when 'Scope'
              key, value = attrs
              @entry['Scope'][key] = value
            end
          end

          def end_element(name)
            case name
            when 'Entries'
              @in_entries = false
            when 'Entry'
              @response['AccessControlList'] << @entry
              @entry = { 'Scope' => {} }
            when 'DisplayName', 'ID'
              if @in_entries
                @entry['Scope'][name] = @value
              else
                @response['Owner'][name] = @value
              end
            when 'Permission'
              @entry[name] = @value
            end
          end

        end

      end
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
fog-0.3.29 lib/fog/google/parsers/storage/access_control_list.rb
fog-0.3.28 lib/fog/google/parsers/storage/access_control_list.rb
fog-0.3.27 lib/fog/google/parsers/storage/access_control_list.rb
fog-0.3.26 lib/fog/google/parsers/storage/access_control_list.rb
fog-0.3.25 lib/fog/google/parsers/storage/access_control_list.rb
fog-0.3.24 lib/fog/google/parsers/storage/access_control_list.rb
bbcloud-0.8.1 lib/bbcloud/vendor/fog-0.3.23/lib/fog/google/parsers/storage/access_control_list.rb
fog-0.3.23 lib/fog/google/parsers/storage/access_control_list.rb
fog-0.3.22 lib/fog/google/parsers/storage/access_control_list.rb
fog-0.3.21 lib/fog/google/parsers/storage/access_control_list.rb
fog-0.3.20 lib/fog/google/parsers/storage/access_control_list.rb
fog-0.3.19 lib/fog/google/parsers/storage/access_control_list.rb
fog-0.3.18 lib/fog/google/parsers/storage/access_control_list.rb
fog-0.3.17 lib/fog/google/parsers/storage/access_control_list.rb