Class: Apia::Definitions::ArgumentSet

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

Direct Known Subclasses

LookupArgumentSet

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

#argumentsObject (readonly)

Returns the value of attribute arguments.



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

def arguments
  @arguments
end

Instance Method Details

#dslObject



17
18
19
# File 'lib/apia/definitions/argument_set.rb', line 17

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

#setupObject



13
14
15
# File 'lib/apia/definitions/argument_set.rb', line 13

def setup
  @arguments = {}
end

#validate(errors) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/apia/definitions/argument_set.rb', line 21

def validate(errors)
  @arguments.each do |name, argument|
    if argument.is_a?(Apia::Definitions::Argument)
      argument.validate(errors)
    else
      errors.add self, 'InvalidArgument', "The argument '#{name}' is not an instance of Apia::Definitions::Argument"
    end
  end
end