Class: PensioAPI::Responses::Terminal

Inherits:
Base
  • Object
show all
Includes:
Enumerable
Defined in:
lib/pensio_api/responses/terminal.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#raw

Instance Method Summary collapse

Methods inherited from Base

#success?

Methods included from Mixins::MethodMissing

#method_missing

Constructor Details

#initialize(request) ⇒ Terminal

Returns a new instance of Terminal.



8
9
10
11
12
# File 'lib/pensio_api/responses/terminal.rb', line 8

def initialize(request)
  super(request)

  map_terminals
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PensioAPI::Mixins::MethodMissing

Instance Attribute Details

#terminalsObject (readonly)

Returns the value of attribute terminals.



6
7
8
# File 'lib/pensio_api/responses/terminal.rb', line 6

def terminals
  @terminals
end

Instance Method Details

#eachObject



14
15
16
# File 'lib/pensio_api/responses/terminal.rb', line 14

def each
  @terminals.each { |t| yield t }
end

#lastObject



18
19
20
# File 'lib/pensio_api/responses/terminal.rb', line 18

def last
  @terminals.last
end