Sha256: 0e092260a644cbecb2890a6d7649875a7152d0340158cc4666c1d1ce29499457

Contents?: true

Size: 943 Bytes

Versions: 2

Compression:

Stored size: 943 Bytes

Contents

module Orghunter
  class Charity
    attr_reader :name, :category, :org_hunter_URL, :donation_URL, :city, :state, :zip_code, :status, :search_score, :website, :mission, :ein

    def initialize(args)
      @name = args["charityName"]
      @category = args["category"]
      @org_hunter_URL = args["url"]
      @donation_URL = args["donationUrl"]
      @eligible_cd = args["eligibleCd"]
      @city = args["city"]
      @state = args["state"]
      @zip_code = args["zipCode"]
      @deductability = args["deductibilityCd"]
      @status = args["statusCd"]
      @search_score = args["score"]
      @website = args["website"]
      @mission = args["missionStatement"]
      @accepting_donations = args["acceptingDonations"]
      @ein = args["ein"]
    end

    def deductable?
      @deductability == 1
    end

    def eligible?
      @eligible_cd == 1
    end

    def accepting_donations?
      @accepting_donations == 1
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
orghunter-0.2.0 lib/orghunter/charity.rb
orghunter-0.1.0 lib/orghunter/charity.rb