Sha256: 13d6c0c22a6879e95037760724c7101ede59d49ba6fc7059bdb829157696343b

Contents?: true

Size: 383 Bytes

Versions: 13

Compression:

Stored size: 383 Bytes

Contents

require 'ns-options'
require 'ns-options/boolean'

class User

  include NsOptions

  options(:preferences) do
    option :home_url
    option :show_messages,  NsOptions::Boolean, :required => 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

13 entries across 13 versions & 1 rubygems

Version Path
ns-options-1.1.6 test/support/user.rb
ns-options-1.1.5 test/support/user.rb
ns-options-1.1.4 test/support/user.rb
ns-options-1.1.3 test/support/user.rb
ns-options-1.1.2 test/support/user.rb
ns-options-1.1.1 test/support/user.rb
ns-options-1.1.0 test/support/user.rb
ns-options-1.0.1 test/support/user.rb
ns-options-1.0.0 test/support/user.rb
ns-options-1.0.0.rc4 test/support/user.rb
ns-options-1.0.0.rc3 test/support/user.rb
ns-options-1.0.0.rc2 test/support/user.rb
ns-options-1.0.0.rc1 test/support/user.rb