Sha256: 57c24c02674d8f70c0911ebf82c0541481b89594ebefdfe3f4d3dc6bd332ce0c

Contents?: true

Size: 667 Bytes

Versions: 32

Compression:

Stored size: 667 Bytes

Contents

module Souls
  module Generate
    def self.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(<<~TEXT)
          class Types::#{singularized_class_name.camelize}Edge < Types::BaseEdge
            node_type(Types::#{singularized_class_name.camelize}Type)
          end
        TEXT
      end
      puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
      file_path
    rescue StandardError => e
      raise(StandardError, e)
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
souls-0.25.12 lib/souls/generate/edge.rb
souls-0.25.11 lib/souls/generate/edge.rb
souls-0.25.10 lib/souls/generate/edge.rb
souls-0.25.9 lib/souls/generate/edge.rb
souls-0.25.8 lib/souls/generate/edge.rb
souls-0.25.7 lib/souls/generate/edge.rb
souls-0.25.6 lib/souls/generate/edge.rb
souls-0.25.5 lib/souls/generate/edge.rb
souls-0.25.4 lib/souls/generate/edge.rb
souls-0.25.3 lib/souls/generate/edge.rb
souls-0.25.2 lib/souls/generate/edge.rb
souls-0.25.1 lib/souls/generate/edge.rb
souls-0.25.0 lib/souls/generate/edge.rb
souls-0.24.14 lib/souls/generate/edge.rb
souls-0.24.13 lib/souls/generate/edge.rb
souls-0.24.12 lib/souls/generate/edge.rb
souls-0.24.11 lib/souls/generate/edge.rb
souls-0.24.10 lib/souls/generate/edge.rb
souls-0.24.9 lib/souls/generate/edge.rb
souls-0.24.8 lib/souls/generate/edge.rb