Class: Zizia::WorkAttributes

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
app/lib/zizia/work_attributes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWorkAttributes

Returns a new instance of WorkAttributes.



18
19
20
21
22
23
24
# File 'app/lib/zizia/work_attributes.rb', line 18

def initialize
  work ||= klass.new
  @local_attributes || work.local_attributes
  @attributes ||= work.local_attributes
  @properties ||= work.send(:properties)
  @validators ||= work.send(:_validators)
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



16
17
18
# File 'app/lib/zizia/work_attributes.rb', line 16

def attributes
  @attributes
end

#local_attributesObject (readonly)

Returns the value of attribute local_attributes.



16
17
18
# File 'app/lib/zizia/work_attributes.rb', line 16

def local_attributes
  @local_attributes
end

#propertiesObject (readonly)

Returns the value of attribute properties.



16
17
18
# File 'app/lib/zizia/work_attributes.rb', line 16

def properties
  @properties
end

#validatorsObject (readonly)

Returns the value of attribute validators.



16
17
18
# File 'app/lib/zizia/work_attributes.rb', line 16

def validators
  @validators
end

Instance Method Details

#klassObject

Override to choose a different Work class



27
28
29
# File 'app/lib/zizia/work_attributes.rb', line 27

def klass
  Work
end