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.
5 6 7 8 9 10 11 |
# File 'lib/raven/interfaces.rb', line 5 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
13 14 15 |
# File 'lib/raven/interfaces.rb', line 13 def self.name(value = nil) @interface_name ||= value end |
Instance Method Details
#to_hash ⇒ Object
17 18 19 |
# File 'lib/raven/interfaces.rb', line 17 def to_hash Hash[instance_variables.map { |name| [name[1..-1].to_sym, instance_variable_get(name)] }] end |