Class: Footnotes::Notes::RpmNote

Inherits:
AbstractNote show all
Defined in:
lib/rails-footnotes/notes/rpm_note.rb

Instance Method Summary collapse

Methods inherited from AbstractNote

close!, #has_fieldset?, included?, #javascript, #legend, #onclick, start!, #stylesheet, #title, title, #to_sym, to_sym

Constructor Details

#initialize(controller) ⇒ RpmNote

Returns a new instance of RpmNote.



7
8
9
# File 'lib/rails-footnotes/notes/rpm_note.rb', line 7

def initialize(controller)
  @rpm_id=NewRelic::Agent.instance.transaction_sampler.current_sample_id
end

Instance Method Details



15
16
17
18
# File 'lib/rails-footnotes/notes/rpm_note.rb', line 15

def link
   #{:controller => 'newrelic', :action => 'show_sample_detail', :id => @rpm_id}
   "/newrelic/show_sample_detail/#{@rpm_id}" if @rpm_id
end

#rowObject



11
12
13
# File 'lib/rails-footnotes/notes/rpm_note.rb', line 11

def row
  :edit
end

#valid?Boolean

Returns:

  • (Boolean)


20
21
22
23
24
25
26
# File 'lib/rails-footnotes/notes/rpm_note.rb', line 20

def valid?
  if defined?(NewRelic::Control)
    !NewRelic::Control.instance['skip_developer_route']
  else
    !NewRelic::Config.instance['skip_developer_route']
  end
end