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

In Files

  • json/lib/json/editor.rb

JSON::Editor::OptionsMenu

Attributes

pretty_item[R]

Public Instance Methods

collapsed_nodes(item) click to toggle source

Collapse/Expand all nodes by default.

 
               # File json/lib/json/editor.rb, line 663
def collapsed_nodes(item)
  if expanded
    self.expanded = false
    collapse_all
  else
    self.expanded = true
    expand_all 
  end
end
            
create() click to toggle source

Create the menu.

 
               # File json/lib/json/editor.rb, line 682
def create
  title = MenuItem.new('Options')
  title.submenu = menu
  add_item('Collapsed nodes', nil, CheckMenuItem, &method(:collapsed_nodes))
  @pretty_item = add_item('Pretty saving', nil, CheckMenuItem,
    &method(:pretty_saving))
  @pretty_item.active = true
  window.unchange
  title
end
            
pretty_saving(item) click to toggle source

Toggle pretty saving mode on/off.

 
               # File json/lib/json/editor.rb, line 674
def pretty_saving(item)
  @pretty_item.toggled
  window.change
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