Sha256: 2c89331f320f6b633f5c8500501018ffc1a263bd7e431d2c9a675d8044623595

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

Contents

# Copyright (C) 2024  Ruby-GNOME Project Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

module Gio
  module ListModel
    include Enumerable

    def each(&block)
      return to_enum(__method__) unless block_given?
      n_items.times do |i|
        yield(get_item(i))
      end
    end

    def [](index)
      get_item(index)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gio2-4.2.7 lib/gio2/list-model.rb
gio2-4.2.6 lib/gio2/list-model.rb
gio2-4.2.5 lib/gio2/list-model.rb
gio2-4.2.4 lib/gio2/list-model.rb
gio2-4.2.3 lib/gio2/list-model.rb