Class: CouchRest::Property

Inherits:
Object show all
Defined in:
lib/couchrest/property.rb,
lib/couchrest/validation/auto_validate.rb

Overview

Basic attribute support for adding getter/setter + validation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type = nil, options = {}) ⇒ Property

attribute to define



8
9
10
11
12
13
# File 'lib/couchrest/property.rb', line 8

def initialize(name, type = nil, options = {})
  @name = name.to_s
  parse_type(type)
  parse_options(options)
  self
end

Instance Attribute Details

#aliasObject (readonly)

Returns the value of attribute alias.



5
6
7
# File 'lib/couchrest/property.rb', line 5

def alias
  @alias
end

#autovalidation_checkObject

flag letting us know if we already checked the autovalidation settings



7
8
9
# File 'lib/couchrest/validation/auto_validate.rb', line 7

def autovalidation_check
  @autovalidation_check
end

#castedObject (readonly)

Returns the value of attribute casted.



5
6
7
# File 'lib/couchrest/property.rb', line 5

def casted
  @casted
end

#defaultObject (readonly)

Returns the value of attribute default.



5
6
7
# File 'lib/couchrest/property.rb', line 5

def default
  @default
end

#init_methodObject (readonly)

Returns the value of attribute init_method.



5
6
7
# File 'lib/couchrest/property.rb', line 5

def init_method
  @init_method
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/couchrest/property.rb', line 5

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/couchrest/property.rb', line 5

def options
  @options
end

#read_onlyObject (readonly)

Returns the value of attribute read_only.



5
6
7
# File 'lib/couchrest/property.rb', line 5

def read_only
  @read_only
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/couchrest/property.rb', line 5

def type
  @type
end