class Onoma::Migration::Actions::ItemChange
Attributes
Public Class Methods
Source
# File lib/onoma/migration/actions/item_change.rb, line 6 def initialize(element) name = element['item'].split('#') @nomenclature = name.first @name = name.second @changes = element.attributes .delete_if { |k, _v| %w[item].include?(k) } .each_with_object({}) do |(k, v), h| h[k.to_sym] = (v.to_s.blank? ? nil : v.to_s) end end
Public Instance Methods
Source
# File lib/onoma/migration/actions/item_change.rb, line 25 def human_name "Change item #{@nomenclature}##{@name} with " + changes.inspect end
Source
# File lib/onoma/migration/actions/item_change.rb, line 21 def new_name @changes[:name] end
Source
# File lib/onoma/migration/actions/item_change.rb, line 17 def new_name? @changes[:name].present? end