Module: Masterplan

Defined in:
lib/masterplan.rb,
lib/masterplan/rule.rb,
lib/masterplan/document.rb,
lib/masterplan/define_rules.rb

Defined Under Namespace

Modules: DefineRules Classes: Document, FailedError, Rule

Class Method Summary collapse

Class Method Details

.compare(options = {:scheme => {}, :to => {}, :format => :full}) ⇒ Object

Raises:

  • (ArgumentError)


20
21
22
23
24
25
26
27
28
29
# File 'lib/masterplan.rb', line 20

def compare(options = {:scheme => {}, :to => {}, :format => :full})
  scheme = options[:scheme]
  testee = options[:to]
  format = options[:format] || :full
  raise ArgumentError, ":to needs to be a hash !" unless testee.is_a?(Hash)
  raise ArgumentError, ":scheme needs to be a Masterplan::Document !" unless scheme.is_a?(Document)
  raise ArgumentError, ":format needs to be one of [:full, :mini] !" unless [:full, :mini].include?(format)
  compare_hash(scheme, testee, format)
  true
end