Class: Infrastructure::DTO

Inherits:
Object
  • Object
show all
Defined in:
lib/podrb/infrastructure/dto.rb

Instance Method Summary collapse

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

Returns:

  • (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