Sha256: 49407af43a51e196edf826cdf81d1546cb026fd55050b1bbb9025e74457bac82

Contents?: true

Size: 439 Bytes

Versions: 1

Compression:

Stored size: 439 Bytes

Contents

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

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

  include Mongoid::Document

  field :token, :type => String

  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

1 entries across 1 versions & 1 rubygems

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