Sha256: 94d83fc71dd4f741cfbe572f8d42ec74c11691f5dad48e15eef1dca87667b2b9
Contents?: true
Size: 990 Bytes
Versions: 2
Compression:
Stored size: 990 Bytes
Contents
# frozen_string_literal: true module NgrokAPI module Models ## # A resource representing multiple instances from a given "list" API call class Listable attr_reader :client, :klass, :iter, :items, :list_property, :next_page_uri, :result, :uri def initialize(client:, result:, list_property:, klass:) @client = client @result = result @list_property = list_property @next_page_uri = @result['next_page_uri'] @uri = @result['uri'] @items = @result[list_property].map do |item| klass.new(client: client, result: item) end @iter = NgrokAPI::PagedIterator.new( client: client, page: self, list_property: list_property ) end def ==(other) @result == other.result end def to_s @result.to_s end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ngrok-api-0.12.0 | lib/ngrokapi/models/listable.rb |
ngrok-api-0.9.0 | lib/ngrokapi/models/listable.rb |