Class: Brujula::TypeExtender::RamlType

Inherits:
Object
  • Object
show all
Defined in:
lib/brujula/type_extender/raml_type.rb

Constant Summary collapse

RAML_TYPES =
%w( object number string integer boolean date file array )

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(definition:) ⇒ RamlType

Returns a new instance of RamlType.



9
10
11
# File 'lib/brujula/type_extender/raml_type.rb', line 9

def initialize(definition:)
  @definition = definition
end

Instance Attribute Details

#definitionObject (readonly)

Returns the value of attribute definition.



7
8
9
# File 'lib/brujula/type_extender/raml_type.rb', line 7

def definition
  @definition
end

Instance Method Details

#callObject



13
14
15
16
17
# File 'lib/brujula/type_extender/raml_type.rb', line 13

def call
  return definition unless custom_type?

  expand_object
end