Class: FaithTeams::API::V2::Entity::ContributionType

Inherits:
Base
  • Object
show all
Defined in:
lib/faithteams/api/v2/entity/contribution_type.rb

Overview

Wraps a faithteams contribution type object.

Instance Method Summary collapse

Methods inherited from Base

#initialize, #saved?, #to_h

Constructor Details

This class inherits a constructor from FaithTeams::API::V2::Entity::Base

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/faithteams/api/v2/entity/contribution_type.rb', line 30

def active?
  (status || "I").strip.upcase == "A"
end

#idInteger?

Returns:

  • (Integer, nil)


10
11
12
# File 'lib/faithteams/api/v2/entity/contribution_type.rb', line 10

def id
  read_attribute(:contributionTypeId)
end

#nameString?

Returns:

  • (String, nil)


15
16
17
# File 'lib/faithteams/api/v2/entity/contribution_type.rb', line 15

def name
  read_attribute(:name).presence
end

#statusString?

Returns "A" for active, "I" for inactive.

Returns:

  • (String, nil)

    "A" for active, "I" for inactive



20
21
22
# File 'lib/faithteams/api/v2/entity/contribution_type.rb', line 20

def status
  read_attribute(:status).presence
end

#tithely?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/faithteams/api/v2/entity/contribution_type.rb', line 25

def tithely?
  (name || "").strip.downcase == "tithely"
end