Sha256: 2ea1f7b4faed604d1046a6bfa759b5245606fa5eb5d340ef137d0bee781cd386

Contents?: true

Size: 256 Bytes

Versions: 9

Compression:

Stored size: 256 Bytes

Contents

# frozen_string_literal: true

require_relative "setup"
require "ryo"

class Point
  def initialize
    @x = 5
    @y = 10
  end

  def each_pair
    yield("x", @x)
    yield("y", @y)
  end
end

option = Ryo(Point.new)
p option.x # => 5
p option.y # => 10

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ryo.rb-0.5.5 share/ryo.rb/examples/6_beyond_hash_objects.rb
ryo.rb-0.5.3 share/ryo.rb/examples/6_beyond_hash_objects.rb
ryo.rb-0.5.2 share/ryo.rb/examples/6_beyond_hash_objects.rb
ryo.rb-0.5.1 share/ryo.rb/examples/6_beyond_hash_objects.rb
ryo.rb-0.5.0 share/ryo.rb/examples/6_beyond_hash_objects.rb
ryo.rb-0.4.7 share/ryo.rb/examples/6_beyond_hash_objects.rb
ryo.rb-0.4.6 share/ryo.rb/examples/6_beyond_hash_objects.rb
ryo.rb-0.4.5 share/ryo.rb/examples/6_beyond_hash_objects.rb
ryo.rb-0.4.4 share/ryo.rb/examples/6_beyond_hash_objects.rb