Class: Raven::Interface
- Inherits:
-
Object
- Object
- Raven::Interface
- Defined in:
- lib/raven/interfaces.rb
Direct Known Subclasses
ExceptionInterface, HttpInterface, MessageInterface, SingleExceptionInterface, StacktraceInterface, StacktraceInterface::Frame
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = nil) {|_self| ... } ⇒ Interface
constructor
A new instance of Interface.
- #to_hash ⇒ Object
Constructor Details
#initialize(attributes = nil) {|_self| ... } ⇒ Interface
Returns a new instance of Interface.
6 7 8 9 10 11 12 |
# File 'lib/raven/interfaces.rb', line 6 def initialize(attributes = nil) attributes.each do |attr, value| public_send "#{attr}=", value end if attributes yield self if block_given? end |
Class Method Details
.name(value = nil) ⇒ Object
14 15 16 |
# File 'lib/raven/interfaces.rb', line 14 def self.name(value = nil) @interface_name ||= value end |
Instance Method Details
#to_hash ⇒ Object
18 19 20 |
# File 'lib/raven/interfaces.rb', line 18 def to_hash Hash[instance_variables.map { |name| [name[1..-1].to_sym, instance_variable_get(name)] } ] end |