Sha256: 1d56303951248f65f35001066c259674e312973d55ab8c032d584acabc9afdb9

Contents?: true

Size: 651 Bytes

Versions: 8

Compression:

Stored size: 651 Bytes

Contents

module Souls
  module Generate
    class << self
      def edge class_name: "souls"
        singularized_class_name = class_name.underscore.singularize
        file_path = "./app/graphql/types/edges/#{singularized_class_name}_edge.rb"
        File.open(file_path, "w") do |f|
          f.write <<~EOS
            class Types::#{singularized_class_name.camelize}Edge < Types::BaseEdge
              node_type(Types::#{singularized_class_name.camelize}Type)
            end
          EOS
        end
        puts "Created file! : #{file_path}"
        file_path
      rescue StandardError => e
        raise StandardError, e
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
souls-0.22.9 lib/souls/generate/edge.rb
souls-0.22.8 lib/souls/generate/edge.rb
souls-0.22.7 lib/souls/generate/edge.rb
souls-0.22.6 lib/souls/generate/edge.rb
souls-0.22.5 lib/souls/generate/edge.rb
souls-0.22.4 lib/souls/generate/edge.rb
souls-0.22.3 lib/souls/generate/edge.rb
souls-0.22.2 lib/souls/generate/edge.rb