class

Tryst::Platform

Inherits Reference < Object

Constants

DEFAULT_PLATFORM = {% if flag?(:darwin) %} "darwin" {% elsif flag?(:linux) %} "linux" {% elsif flag?(:win32) %} "win32-mingw" {% else %} "unknown" {% end %}

Ruby-tryst defaults to RUBY_PLATFORM (e.g. "arm64-darwin24", "x86_64-linux", "x64-mingw-ucrt") - Crystal has no equivalent runtime constant, so this is built from its compile-time target flags instead. The windows case deliberately contains "mingw" (not just "windows") so it round-trips through #windows?'s own mingw/mswin/cygwin regex, matching ruby-tryst's exactly.

Constructors

new(platform : String = DEFAULT_PLATFORM)
Source

Instance methods

darwin?
Source
linux?
Source
to_s(io : IO) : Nil

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source
windows?
Source