@@ -4,48 +4,13 @@ import { Mode } from "../../shared/mode";
44import { parseGenerateModelResults } from "./generate" ;
55import type { MethodArgument } from "../../method" ;
66import { getArgumentsList } from "../../method" ;
7-
8- function parseRubyMethodFromPath ( path : string ) : string {
9- const match = path . match ( / M e t h o d \[ ( [ ^ \] ] + ) ] .* / ) ;
10- if ( match ) {
11- return match [ 1 ] ;
12- } else {
13- return "" ;
14- }
15- }
16-
17- function parseRubyAccessPath ( path : string ) : {
18- methodName : string ;
19- path : string ;
20- } {
21- const match = path . match ( / M e t h o d \[ ( [ ^ \] ] + ) ] \. ( .* ) / ) ;
22- if ( match ) {
23- return { methodName : match [ 1 ] , path : match [ 2 ] } ;
24- } else {
25- return { methodName : "" , path : "" } ;
26- }
27- }
28-
29- function rubyMethodSignature ( typeName : string , methodName : string ) {
30- return `${ typeName } #${ methodName } ` ;
31- }
32-
33- function rubyMethodPath ( methodName : string ) {
34- if ( methodName === "" ) {
35- return "" ;
36- }
37-
38- return `Method[${ methodName } ]` ;
39- }
40-
41- function rubyPath ( methodName : string , path : string ) {
42- const methodPath = rubyMethodPath ( methodName ) ;
43- if ( methodPath === "" ) {
44- return path ;
45- }
46-
47- return `${ methodPath } .${ path } ` ;
48- }
7+ import {
8+ parseRubyAccessPath ,
9+ parseRubyMethodFromPath ,
10+ rubyMethodPath ,
11+ rubyMethodSignature ,
12+ rubyPath ,
13+ } from "./access-paths" ;
4914
5015export const ruby : ModelsAsDataLanguage = {
5116 availableModes : [ Mode . Framework ] ,
0 commit comments