Class: Merb::Inspector

Inherits:
Application
  • Object
show all
Defined in:
lib/merb_inspector/helper.rb,
lib/merb_inspector/manager.rb,
lib/merb_inspector/inspector.rb

Defined Under Namespace

Modules: Helper, Manager Classes: ActionNotFound

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.defaultObject



15
16
17
# File 'lib/merb_inspector/inspector.rb', line 15

def self.default
  Inspector
end

.log(message) ⇒ Object



19
20
21
22
23
# File 'lib/merb_inspector/inspector.rb', line 19

def self.log(message)
  path = Merb.root / "log" / "inspector.log"
  message = "[Inspector] %s" % message.to_s.strip
  File.open(path, "a+") {|f| f.puts message}
end

.model(model, inspector = self) ⇒ Object



25
26
27
# File 'lib/merb_inspector/inspector.rb', line 25

def self.model(model, inspector = self)
  Merb::Inspector::Manager.register(model, inspector)
end

.rootObject

for module



11
12
13
# File 'lib/merb_inspector/inspector.rb', line 11

def self.root
  @root ||= Pathname(File.expand_path(File.dirname(__FILE__) + "/../../"))
end

Instance Method Details

#show(object, options = {}) ⇒ Object

for class



32
33
34
35
36
37
# File 'lib/merb_inspector/inspector.rb', line 32

def show(object, options = {})
  @object  = object
  @options = options

  execute
end