Extended maintenance of Ruby versions 1.8.7 and 1.9.2 will end on July 31, 2014. Read more

In Files

  • json/lib/json/editor.rb

JSON::Editor::Gtk::TreeIter

The Gtk::TreeIter class is reopened and some auxiliary methods are added.

Public Instance Methods

content() click to toggle source

Returns the content of this node.

 
               # File json/lib/json/editor.rb, line 195
def content
  self[CONTENT_COL]
end
            
content=(value) click to toggle source

Sets the content of this node to value.

 
               # File json/lib/json/editor.rb, line 200
def content=(value)
  self[CONTENT_COL] = value
end
            
each() click to toggle source

Traverse each of this Gtk::TreeIter instance’s children and yield to them.

 
               # File json/lib/json/editor.rb, line 161
def each
  n_children.times { |i| yield nth_child(i) }
end
            
recursive_each(&block) click to toggle source

Recursively traverse all nodes of this Gtk::TreeIter’s subtree (including self) and yield to them.

 
               # File json/lib/json/editor.rb, line 167
def recursive_each(&block)
  yield self
  each do |i|
    i.recursive_each(&block)
  end
end
            
remove_subtree(model) click to toggle source

Remove the subtree of this Gtk::TreeIter instance from the model model.

 
               # File json/lib/json/editor.rb, line 176
def remove_subtree(model)
  while current = first_child
    model.remove(current)
  end
end
            
type() click to toggle source

Returns the type of this node.

 
               # File json/lib/json/editor.rb, line 183
def type
  self[TYPE_COL]
end
            
type=(value) click to toggle source

Sets the type of this node to value. This implies setting the respective icon accordingly.

 
               # File json/lib/json/editor.rb, line 189
def type=(value)
  self[TYPE_COL] = value
  self[ICON_COL] = Editor.fetch_icon(value)
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus