Sha256: c6938d7239e450a45f83af343ff044576797b373ce2a944d8db12fa65a4ed669

Contents?: true

Size: 440 Bytes

Versions: 5

Compression:

Stored size: 440 Bytes

Contents

require 'ns-options/boolean'

class User

  # mixin using the specific HasOptions variant
  include NsOptions::HasOptions

  options(:preferences, 'user-preferences') do
    option :home_url
    option :show_messages,  NsOptions::Boolean, :require => true
    option :font_size,      Integer,            :default => 12

    namespace :view do
      option :color
    end
  end

  def preferences_key
    "user_#{self.object_id}"
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ns-options-0.4.1 test/support/user.rb
ns-options-0.4.0 test/support/user.rb
ns-options-0.3.1 test/support/user.rb
ns-options-0.3.0 test/support/user.rb
ns-options-0.2.0 test/support/user.rb