Class: IletiMerkezi::Report

Inherits:
Object
  • Object
show all
Includes:
XmlBuilder
Defined in:
lib/ileti_merkezi/actions/report.rb

Overview

Report

Constant Summary collapse

PATH =
'/get-report'

Constants included from XmlBuilder

XmlBuilder::XML_TAG

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from XmlBuilder

#hash_to_xml

Constructor Details

#initialize(order_id, page: 1, row_count: 1000) ⇒ Report

Returns a new instance of Report.



11
12
13
14
15
# File 'lib/ileti_merkezi/actions/report.rb', line 11

def initialize(order_id, page: 1, row_count: 1000)
  @order_id  = order_id
  @page      = page
  @row_count = row_count
end

Instance Attribute Details

#order_idObject (readonly)

Returns the value of attribute order_id.



9
10
11
# File 'lib/ileti_merkezi/actions/report.rb', line 9

def order_id
  @order_id
end

#pageObject (readonly)

Returns the value of attribute page.



9
10
11
# File 'lib/ileti_merkezi/actions/report.rb', line 9

def page
  @page
end

#row_countObject (readonly)

Returns the value of attribute row_count.



9
10
11
# File 'lib/ileti_merkezi/actions/report.rb', line 9

def row_count
  @row_count
end

Instance Method Details

#queryObject



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/ileti_merkezi/actions/report.rb', line 17

def query
  request = Request.new(
    path: PATH,
    payload: hash_to_xml(
      id: order_id,
      page: page,
      row_count: row_count
    )
  )
  request.call
end