Sha256: 0b62c94abf6a6225f40e8c1abfd66df754da2674832fdab2f2622fc6d110eace

Contents?: true

Size: 838 Bytes

Versions: 5

Compression:

Stored size: 838 Bytes

Contents

# frozen_string_literal: true

module FaithTeams
  module API
    module V2
      module Entity
        # Wraps a faithteams contribution type object.
        class ContributionType < Base
          # @return [Integer, nil]
          def id
            read_attribute(:contributionTypeId)
          end

          # @return [String, nil]
          def name
            read_attribute(:name).presence
          end

          # @return [String, nil] "A" for active, "I" for inactive
          def status
            read_attribute(:status).presence
          end

          # @return [Boolean]
          def tithely?
            (name || "").strip.downcase == "tithely"
          end

          # @return [Boolean]
          def active?
            (status || "I").strip.upcase == "A"
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
faithteams-api-4.2.0 lib/faithteams/api/v2/entity/contribution_type.rb
faithteams-api-4.1.1 lib/faithteams/api/v2/entity/contribution_type.rb
faithteams-api-4.0.1 lib/faithteams/api/v2/entity/contribution_type.rb
faithteams-api-2.0.2 lib/faithteams/api/v2/entity/contribution_type.rb
faithteams-api-2.0.1 lib/faithteams/api/v2/entity/contribution_type.rb