Class: Swiftfake::SourceKitParser

Inherits:
Object
  • Object
show all
Defined in:
lib/swiftfake/source_kit_parser.rb

Defined Under Namespace

Classes: FunctionParser

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#source_fileObject (readonly)

Returns the value of attribute source_file.



8
9
10
# File 'lib/swiftfake/source_kit_parser.rb', line 8

def source_file
  @source_file
end

#structure_jsonObject (readonly)

Returns the value of attribute structure_json.



8
9
10
# File 'lib/swiftfake/source_kit_parser.rb', line 8

def structure_json
  @structure_json
end

Instance Method Details

#parse(source_file, raw_structure_json) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/swiftfake/source_kit_parser.rb', line 10

def parse(source_file, raw_structure_json)
  @source_file = source_file
  @structure_json = JSON.parse(raw_structure_json)

  SwiftClass.new(
    name: class_name,
    access: access_level,
    functions: parse_functions,
    imports: imports
  )
end