Class: Lebowski::SCUI::Mixins::NodeItemViewSupport::Support::LinksArray

Inherits:
Foundation::ObjectArray show all
Defined in:
lib/lebowski/scui/mixins/node_item_view_support.rb

Constant Summary

Constants included from Foundation

Foundation::SC_BRANCH_CLOSED, Foundation::SC_BRANCH_OPEN, Foundation::SC_BUTTON1_STATUS, Foundation::SC_BUTTON2_STATUS, Foundation::SC_BUTTON3_STATUS, Foundation::SC_LEAF_NODE, Foundation::SC_MIXED_STATE, Foundation::SC_PICKER_FIXED, Foundation::SC_PICKER_MENU, Foundation::SC_PICKER_POINTER, Foundation::SC_T_ARRAY, Foundation::SC_T_BOOL, Foundation::SC_T_CLASS, Foundation::SC_T_ERROR, Foundation::SC_T_FUNCTION, Foundation::SC_T_HASH, Foundation::SC_T_NULL, Foundation::SC_T_NUMBER, Foundation::SC_T_OBJECT, Foundation::SC_T_STRING, Foundation::SC_T_UNDEFINED

Instance Method Summary collapse

Methods inherited from Foundation::ObjectArray

#[], #all?, #any?, #count, #each, #empty?, #filter, #find_all, #find_first, #find_indexes, #find_last, #first, #index_of, #last, #member?, #none?, #one?, #prefilter

Constructor Details

#initialize(parent) ⇒ LinksArray

Returns a new instance of LinksArray.



147
148
149
150
# File 'lib/lebowski/scui/mixins/node_item_view_support.rb', line 147

def initialize(parent)
  links_key = parent['content.linksKey']
  super(parent, "content.#{links_key}")
end

Instance Method Details

#create_object(index, expected_type = nil) ⇒ Object



152
153
154
155
156
157
158
# File 'lib/lebowski/scui/mixins/node_item_view_support.rb', line 152

def create_object(index, expected_type=nil)
  rel_path = "#{@array_rel_path}.#{index}"
  obj = @parent[rel_path, expected_type]

  mix_in_support_for_object obj
  return obj
end

#mix_in_support_for_object(obj) ⇒ Object



160
161
162
163
164
# File 'lib/lebowski/scui/mixins/node_item_view_support.rb', line 160

def mix_in_support_for_object(obj)
  if not obj.class.ancestors.member? Lebowski::SCUI::Mixins::LinkSupport
    obj.extend Lebowski::SCUI::Mixins::LinkSupport
  end
end