Sha256: ac160f542b138aa36d08b589816b5542a601282f34fecfb2d225df6e20cb4df9
Contents?: true
Size: 902 Bytes
Versions: 135
Compression:
Stored size: 902 Bytes
Contents
module Expressir module Express class InterfacedItem attr_accessor :name, :original_name, :foreign_schema, :foreign_type def initialize(attributes = {}) @original_name = nil @attributes = attributes end def parse schema = attributes.extract(:schema, nil) document = attributes.extract(:document, nil) extract_attributes(document, schema) end def self.parse(document, schema) new(document: document, schema: schema).parse end private attr_reader :attributes def extract_attributes(document, schema) @foreign_schema = schema @name = document.attributes["name"].to_s if document.attributes["alias"] != nil @name = document.attributes["alias"].to_s @original_name = document.attributes["name"].to_s end end end end end
Version data entries
135 entries across 135 versions & 1 rubygems