Class: CouchRest::Property
- Defined in:
- lib/couchrest/more/property.rb,
lib/couchrest/validation/auto_validate.rb
Overview
Basic attribute support for adding getter/setter + validation
Instance Attribute Summary collapse
-
#alias ⇒ Object
readonly
Returns the value of attribute alias.
-
#autovalidation_check ⇒ Object
flag letting us know if we already checked the autovalidation settings.
-
#casted ⇒ Object
readonly
Returns the value of attribute casted.
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#init_method ⇒ Object
readonly
Returns the value of attribute init_method.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#read_only ⇒ Object
readonly
Returns the value of attribute read_only.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type = nil, options = {}) ⇒ Property
constructor
attribute to define.
Constructor Details
#initialize(name, type = nil, options = {}) ⇒ Property
attribute to define
8 9 10 11 12 13 |
# File 'lib/couchrest/more/property.rb', line 8 def initialize(name, type = nil, = {}) @name = name.to_s parse_type(type) () self end |
Instance Attribute Details
#alias ⇒ Object (readonly)
Returns the value of attribute alias.
5 6 7 |
# File 'lib/couchrest/more/property.rb', line 5 def alias @alias end |
#autovalidation_check ⇒ Object
flag letting us know if we already checked the autovalidation settings
8 9 10 |
# File 'lib/couchrest/validation/auto_validate.rb', line 8 def autovalidation_check @autovalidation_check end |
#casted ⇒ Object (readonly)
Returns the value of attribute casted.
5 6 7 |
# File 'lib/couchrest/more/property.rb', line 5 def casted @casted end |
#default ⇒ Object (readonly)
Returns the value of attribute default.
5 6 7 |
# File 'lib/couchrest/more/property.rb', line 5 def default @default end |
#init_method ⇒ Object (readonly)
Returns the value of attribute init_method.
5 6 7 |
# File 'lib/couchrest/more/property.rb', line 5 def init_method @init_method end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/couchrest/more/property.rb', line 5 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/couchrest/more/property.rb', line 5 def @options end |
#read_only ⇒ Object (readonly)
Returns the value of attribute read_only.
5 6 7 |
# File 'lib/couchrest/more/property.rb', line 5 def read_only @read_only end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/couchrest/more/property.rb', line 5 def type @type end |