File: projects.rb

package info (click to toggle)
ruby-fog-google 1.29.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,160 kB
  • sloc: ruby: 14,258; makefile: 3
file content (19 lines) | stat: -rw-r--r-- 428 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Fog
  module Google
    class Compute
      class Projects < Fog::Collection
        model Fog::Google::Compute::Project

        def get(identity)
          if identity
            project = service.get_project(identity).to_h
            return new(project)
          end
        rescue ::Google::Apis::ClientError => e
          raise e unless e.status_code == 404
          nil
        end
      end
    end
  end
end