Class: RFunk::TypeAnnotation

Inherits:
Object
  • Object
show all
Defined in:
lib/rfunk/attribute/type_annotation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(annotation) ⇒ TypeAnnotation

Returns a new instance of TypeAnnotation.



5
6
7
8
9
10
11
12
# File 'lib/rfunk/attribute/type_annotation.rb', line 5

def initialize(annotation)
  option = RFunk::Option(annotation)
  split = option.split('->')
  parameters = split.select { |v| v.count == 2 }

  @parameters = create_parameters(parameters)
  @return = create_return(split)
end

Instance Attribute Details

#parametersObject (readonly)

Returns the value of attribute parameters.



3
4
5
# File 'lib/rfunk/attribute/type_annotation.rb', line 3

def parameters
  @parameters
end

#returnObject (readonly)

Returns the value of attribute return.



3
4
5
# File 'lib/rfunk/attribute/type_annotation.rb', line 3

def return
  @return
end