Class: Raven::Interface
- Inherits:
-
Hashie::Dash
- Object
- Hashie::Dash
- Raven::Interface
show all
- Includes:
- Hashie::Extensions::Dash::IndifferentAccess
- Defined in:
- lib/raven/interfaces.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(attributes = {}, &block) ⇒ Interface
Returns a new instance of Interface.
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/raven/interfaces.rb', line 12
def initialize(attributes = {}, &block)
@check_required = false
super(attributes)
block.call(self) if block
@check_required = true
begin
assert_required_attributes_set!
rescue NoMethodError
assert_required_properties_set!
end
end
|
Class Method Details
.name(value = nil) ⇒ Object
34
35
36
37
|
# File 'lib/raven/interfaces.rb', line 34
def self.name(value = nil)
@interface_name = value if value
@interface_name
end
|
Instance Method Details
#assert_required_attributes_set! ⇒ Object
26
27
28
|
# File 'lib/raven/interfaces.rb', line 26
def assert_required_attributes_set!
super if @check_required
end
|
#assert_required_properties_set! ⇒ Object
30
31
32
|
# File 'lib/raven/interfaces.rb', line 30
def assert_required_properties_set!
super if @check_required
end
|