Sha256: d221b9c8cf7677852435d9d699b9f4ae2291ac150ed6629f05ffe0953f4000c1

Contents?: true

Size: 793 Bytes

Versions: 95

Compression:

Stored size: 793 Bytes

Contents

class PaymentIcon < FrozenRecord::Base
  self.base_path = File.expand_path('../../db/', __dir__)

  GROUPS = {
      credit_cards: 'Credit cards',
      cryptocurrencies: 'Digital currencies',
      bank_transfers: 'Bank transfers',
      wallets: 'Digital wallets',
      convenience_stores: 'Convenience Stores',
      other: 'Other'
    }

  def path
    "payment_icons/#{name}.svg"
  end

  def self.find_by_group(group)
    where(group: group)
  end

  def self.credit_cards
    where(group: 'credit_cards')
  end

  def self.cryptocurrencies
    where(group: 'cryptocurrencies')
  end

  def self.bank_transfers
    where(group: 'bank_transfers')
  end

  def self.wallets
    where(group: 'wallets')
  end

  def self.convenience_stores
    where(group: 'convenience_stores')
  end
end

Version data entries

95 entries across 95 versions & 1 rubygems

Version Path
payment_icons-1.5.0 app/models/payment_icon.rb
payment_icons-1.4.10 app/models/payment_icon.rb
payment_icons-1.4.9 app/models/payment_icon.rb
payment_icons-1.4.8 app/models/payment_icon.rb
payment_icons-1.4.7 app/models/payment_icon.rb
payment_icons-1.4.6 app/models/payment_icon.rb
payment_icons-1.4.5 app/models/payment_icon.rb
payment_icons-1.4.4 app/models/payment_icon.rb
payment_icons-1.4.3 app/models/payment_icon.rb
payment_icons-1.4.2 app/models/payment_icon.rb
payment_icons-1.4.1 app/models/payment_icon.rb
payment_icons-1.4.0 app/models/payment_icon.rb
payment_icons-1.3.9 app/models/payment_icon.rb
payment_icons-1.3.7 app/models/payment_icon.rb
payment_icons-1.3.6 app/models/payment_icon.rb
payment_icons-1.3.5 app/models/payment_icon.rb
payment_icons-1.3.4 app/models/payment_icon.rb
payment_icons-1.3.3 app/models/payment_icon.rb
payment_icons-1.3.2 app/models/payment_icon.rb
payment_icons-1.3.0 app/models/payment_icon.rb