Sha256: ba193f3ae624ee136082057da140ad8877711b025f2120ab065b784034e12185

Contents?: true

Size: 328 Bytes

Versions: 42

Compression:

Stored size: 328 Bytes

Contents

module ActiveGraph::Node
  class NodeListFormatter
    def initialize(list, max_elements = 5)
      @list = list
      @max_elements = max_elements
    end

    def inspect
      return @list.inspect if !@max_elements || @list.length <= @max_elements
      "[#{@list.take(5).map!(&:inspect).join(', ')}, ...]"
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
activegraph-10.1.1 lib/active_graph/node/node_list_formatter.rb
activegraph-11.0.1-java lib/active_graph/node/node_list_formatter.rb
activegraph-11.0.0-java lib/active_graph/node/node_list_formatter.rb
activegraph-10.1.0 lib/active_graph/node/node_list_formatter.rb
activegraph-11.0.0.beta.4-java lib/active_graph/node/node_list_formatter.rb
activegraph-10.0.2 lib/active_graph/node/node_list_formatter.rb
activegraph-11.0.0.beta.3-java lib/active_graph/node/node_list_formatter.rb
activegraph-11.0.0.beta.2-java lib/active_graph/node/node_list_formatter.rb
activegraph-11.0.0.beta.1-java lib/active_graph/node/node_list_formatter.rb
activegraph-10.0.1 lib/active_graph/node/node_list_formatter.rb
activegraph-10.0.0 lib/active_graph/node/node_list_formatter.rb
activegraph-10.0.0.pre.beta.11 lib/active_graph/node/node_list_formatter.rb
activegraph-10.0.0.pre.beta.10 lib/active_graph/node/node_list_formatter.rb
activegraph-10.0.0.pre.beta.9 lib/active_graph/node/node_list_formatter.rb
activegraph-10.0.0.pre.beta.8 lib/active_graph/node/node_list_formatter.rb
activegraph-10.0.0.pre.beta.7 lib/active_graph/node/node_list_formatter.rb
activegraph-10.0.0.pre.beta.6 lib/active_graph/node/node_list_formatter.rb
activegraph-10.0.0.pre.beta.5 lib/active_graph/node/node_list_formatter.rb
activegraph-10.0.0.pre.beta.4 lib/active_graph/node/node_list_formatter.rb
activegraph-10.0.0.pre.beta.3 lib/active_graph/node/node_list_formatter.rb