Class: Infrastructure::DTO
- Inherits:
-
Object
- Object
- Infrastructure::DTO
- Defined in:
- lib/podrb/infrastructure/dto.rb
Instance Method Summary collapse
-
#initialize(attrs) ⇒ DTO
constructor
A new instance of DTO.
- #method_missing(symbol, *args) ⇒ Object
- #respond_to_missing?(symbol, include_private = false) ⇒ Boolean
Constructor Details
#initialize(attrs) ⇒ DTO
Returns a new instance of DTO.
5 6 7 |
# File 'lib/podrb/infrastructure/dto.rb', line 5 def initialize(attrs) @attrs = attrs end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args) ⇒ Object
13 14 15 |
# File 'lib/podrb/infrastructure/dto.rb', line 13 def method_missing(symbol, *args) @attrs[symbol] end |
Instance Method Details
#respond_to_missing?(symbol, include_private = false) ⇒ Boolean
9 10 11 |
# File 'lib/podrb/infrastructure/dto.rb', line 9 def respond_to_missing?(symbol, include_private = false) @attrs.key?(symbol) || super end |