Class: Apia::Definitions::Object

Inherits:
Apia::Definition show all
Defined in:
lib/apia/definitions/object.rb

Instance Attribute Summary collapse

Attributes inherited from Apia::Definition

#description, #id, #name, #schema

Instance Method Summary collapse

Methods inherited from Apia::Definition

#initialize, #schema?

Constructor Details

This class inherits a constructor from Apia::Definition

Instance Attribute Details

#conditionsObject (readonly)

Returns the value of attribute conditions.



11
12
13
# File 'lib/apia/definitions/object.rb', line 11

def conditions
  @conditions
end

#fieldsObject (readonly)

Returns the value of attribute fields.



12
13
14
# File 'lib/apia/definitions/object.rb', line 12

def fields
  @fields
end

Instance Method Details

#dslObject



19
20
21
# File 'lib/apia/definitions/object.rb', line 19

def dsl
  @dsl ||= DSLs::Object.new(self)
end

#setupObject



14
15
16
17
# File 'lib/apia/definitions/object.rb', line 14

def setup
  @conditions = []
  @fields = FieldSet.new
end

#validate(errors) ⇒ Object



23
24
25
# File 'lib/apia/definitions/object.rb', line 23

def validate(errors)
  @fields.validate(errors, self)
end