module Yoda::Model::Types

Public Class Methods

parse(string) click to toggle source

@param string [String] @return [Types::Base]

# File lib/yoda/model/types.rb, line 20
def self.parse(string)
  Parsing::Generator.new.apply(Parsing::Parser.new.parse(string))
rescue Parslet::ParseFailed => failure
  Types::UnknownType.new(string)
end
parse_type_strings(strings) click to toggle source

@param strings [Array<String>] @return [Types::Base]

# File lib/yoda/model/types.rb, line 28
def self.parse_type_strings(strings)
  Types::UnionType.new(strings.map { |string| parse(string) })
end