File: change.rb

package info (click to toggle)
ruby-fog-google 1.19.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,568 kB
  • sloc: ruby: 16,775; makefile: 3
file content (38 lines) | stat: -rw-r--r-- 929 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
module Fog
  module DNS
    class Google
      ##
      # Represents a Change resource
      #
      # @see https://developers.google.com/cloud-dns/api/v1/changes
      class Change < Fog::Model
        identity :id

        attribute :kind
        attribute :start_time, :aliases => "startTime"
        attribute :status
        attribute :additions
        attribute :deletions

        DONE_STATE    = "done".freeze
        PENDING_STATE = "pending".freeze

        ##
        # Checks if the change operation is pending
        #
        # @return [Boolean] True if the change operation is pending; False otherwise
        def pending?
          status == PENDING_STATE
        end

        ##
        # Checks if the change operation is done
        #
        # @return [Boolean] True if the change operation is done; False otherwise
        def ready?
          status == DONE_STATE
        end
      end
    end
  end
end