# class Chef::Knife::NodeEditor

### Attributes

config[R]
node[R]
ui[R]

### Public Class Methods

new(node, ui, config) click to toggle source

    # File lib/chef/knife/core/node_editor.rb, line 31
    def initialize(node, ui, config)
      @node, @ui, @config = node, ui, config
    end

### Public Instance Methods

edit_node() click to toggle source

    # File lib/chef/knife/core/node_editor.rb, line 35
    def edit_node
      abort "You specified the --disable_editing option, nothing to edit" if config[:disable_editing]
      assert_editor_set!

      updated_node_data = @ui.edit_data(view)
      apply_updates(updated_node_data)
      @updated_node
    end

updated?() click to toggle source

    # File lib/chef/knife/core/node_editor.rb, line 44
    def updated?
      pristine_copy = Chef::JSONCompat.from_json(Chef::JSONCompat.to_json(node), :create_additions => false)
      updated_copy  = Chef::JSONCompat.from_json(Chef::JSONCompat.to_json(@updated_node), :create_additions => false)
      unless pristine_copy == updated_copy
        updated_properties = %w{name normal chef_environment run_list default override automatic}.reject do |key|
           pristine_copy[key] == updated_copy[key]
        end
      end
      ( pristine_copy != updated_copy ) && updated_properties
    end