Class: PayjpMock::Response::List
- Defined in:
- lib/payjp_mock/response/list.rb
Constant Summary collapse
- OBJECT =
'list'.freeze
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(path, count: 3) ⇒ List
constructor
A new instance of List.
- #status ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(path, count: 3) ⇒ List
Returns a new instance of List.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/payjp_mock/response/list.rb', line 5 def initialize(path, count: 3) @attributes = { count: 0, data: [], has_more: false, object: OBJECT, url: "/#{PayjpMock::Request::API_VERSION}" + path } return unless block_given? @attributes[:count] = count @attributes[:data] = count.times.map { yield.to_h } end |
Instance Method Details
#status ⇒ Object
19 20 21 |
# File 'lib/payjp_mock/response/list.rb', line 19 def status 200 end |