Sha256: 092fc8fcf8d253c7e75267cde0994e98378e9f7997d7e30a4db50c582ab69eac

Contents?: true

Size: 387 Bytes

Versions: 10

Compression:

Stored size: 387 Bytes

Contents

class User
  attr_accessor :name, :account, :email

  def initialize name, email = nil, options = {}
    @name = name
    @email = email
    set_option_vars options
  end

  def set_option_vars options = {}
    options.each_pair do |name, value|
      var = :"@#{name}"
      self.instance_variable_set(var, value)
    end
  end

  def email
    @email ||= 'default@gmail.com'
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cantango-core-0.1.9.3 spec/fixtures/models/user.rb
cantango-core-0.1.9.2 spec/fixtures/models/user.rb
cantango-core-0.1.9.1 spec/fixtures/models/user.rb
cantango-core-0.1.9 spec/fixtures/models/user.rb
cantango-core-0.1.8 spec/fixtures/models/user.rb
cantango-core-0.1.7 spec/fixtures/models/user.rb
cantango-core-0.1.6 spec/fixtures/models/user.rb
cantango-core-0.1.5 spec/fixtures/models/user.rb
cantango-core-0.1.4 spec/fixtures/models/user.rb
cantango-core-0.1.3 spec/fixtures/models/user.rb