Sha256: 539875f09764e94a699d2336b3f6f8816157c4e8ca28899cd8fa2b3ae8e2f70b

Contents?: true

Size: 398 Bytes

Versions: 2

Compression:

Stored size: 398 Bytes

Contents

class AnimalError < StandardError; end
class MammalError < StandardError; end

class Cat < ActiveRecord::Base
  class CatError < StandardError; end
  include TokenAction::TokenGenerator

  def self.redeem_token(action = nil)
    case action
    when 'upgrade'
      raise AnimalError.new
    when 'metamorphose'
      raise MammalError.new
    when 'fly'
      raise CatError.new
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
token_action-0.0.2 spec/dummy/app/active_record/cat.rb
token_action-0.0.1 spec/dummy/app/active_record/cat.rb