Sha256: 8b30977c0080f177e6a01300930ff72dfcf83aab1747deb3ab40ba28ee08f9d1

Contents?: true

Size: 781 Bytes

Versions: 6

Compression:

Stored size: 781 Bytes

Contents

require_relative 'test_model'
require_relative 'test_enum'

class TestClassWithAttributes
  include Riveter::Attributes

  attr_string :string, :default => 'A'
  attr_text :text, :default => 'b'
  attr_integer :integer, :default => 1
  attr_decimal :decimal, :default => 9.998
  attr_date :date, :default => Date.new(2010, 1, 12)
  attr_date_range :date_range, :default => Date.new(2010, 1, 12)..Date.new(2011, 1, 12)
  attr_time :time, :default => Time.new(2010, 1, 12, 14, 56)
  attr_boolean :boolean, :default => true
  attr_enum :enum, TestEnum, :default => TestEnum::Member1
  attr_array :array, :default => [1, 2, 3]
  attr_hash :hash, :default => {:a => :b}
  attr_object :object, :default => 'whatever'

  attr_object :with_lambda_default, :default => lambda { self }

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
riveter-0.8.3 spec/support/test_class_with_attributes.rb
riveter-0.8.2 spec/support/test_class_with_attributes.rb
riveter-0.8.1 spec/support/test_class_with_attributes.rb
riveter-0.8.0 spec/support/test_class_with_attributes.rb
riveter-0.7.0 spec/support/test_class_with_attributes.rb
riveter-0.6.0 spec/support/test_class_with_attributes.rb