Module: EPUB::Inspector::PublicationModel

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(mod) ⇒ Object



29
30
31
# File 'lib/epub/inspector.rb', line 29

def included(mod)
  mod.__send__ :include, Inspector
end

Instance Method Details

#inspectObject



34
35
36
37
38
39
40
41
# File 'lib/epub/inspector.rb', line 34

def inspect
  template % {
    :class      => self.class,
    :package    => (package && package.inspect_simply),
    :object_id  => inspect_object_id,
    :attributes => inspect_instance_variables(exclude: [:@package])
  }
end

#templateObject



43
44
45
46
47
# File 'lib/epub/inspector.rb', line 43

def template
  t = "#<%{class}:%{object_id}"
  t << " @package=%{package}" if package
  t << " %{attributes}>"
end