Sha256: 6b008bf97116a309d9ccd8a8b60cf537f92fdeb1e35a2f404dacfc549b3962f4

Contents?: true

Size: 253 Bytes

Versions: 2

Compression:

Stored size: 253 Bytes

Contents

class UserAccount
  attr_accessor :user, :roles

  def initialize user, options = {}
    @user = user
    @options = options
    @roles = options[:roles]
  end
  
  def role? name
    roles.include? name
  end
  
  def roles
    @roles ||= []
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cantango-api-0.1.3 spec/fixtures/models/user_account.rb
cantango-api-0.1.2 spec/fixtures/models/user_account.rb