Class: Lacerda::Specification
- Inherits:
-
Object
- Object
- Lacerda::Specification
- Defined in:
- lib/lacerda/specification.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
-
#initialize(service, schema_or_file) ⇒ Specification
constructor
A new instance of Specification.
- #objects ⇒ Object
Constructor Details
#initialize(service, schema_or_file) ⇒ Specification
Returns a new instance of Specification.
9 10 11 12 |
# File 'lib/lacerda/specification.rb', line 9 def initialize(service, schema_or_file) @service = service load_schema(schema_or_file) end |
Instance Attribute Details
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
7 8 9 |
# File 'lib/lacerda/specification.rb', line 7 def schema @schema end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
7 8 9 |
# File 'lib/lacerda/specification.rb', line 7 def service @service end |
Instance Method Details
#objects ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/lacerda/specification.rb', line 14 def objects return [] unless @schema[:definitions] @schema[:definitions].map do |scoped_name, schema| next if !scoped_name.index(SCOPE_SEPARATOR) object_description_class.new(service, scoped_name, schema) end.compact end |