Class: HotCocoa::OutlineViewDataSource

Inherits:
Object
  • Object
show all
Defined in:
lib/hotcocoa/data_sources/outline_view_data_source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ OutlineViewDataSource

Returns a new instance of OutlineViewDataSource.



5
6
7
# File 'lib/hotcocoa/data_sources/outline_view_data_source.rb', line 5

def initialize data
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/hotcocoa/data_sources/outline_view_data_source.rb', line 3

def data
  @data
end

Instance Method Details

#outlineView(view, objectValueForTableColumn: column, byItem: item) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/hotcocoa/data_sources/outline_view_data_source.rb', line 9

def outlineView view, numberOfChildrenOfItem: item
  if item.nil?
    data.length
  else
    item[:childRows].length
  end
end