class Recras::Booking
links to 'arrangement_regels' in the API recras.github.io/docs/endpoints/contactformulieren.html
Attributes
client[RW]
customer_id[RW]
id[RW]
@note The is a required parameter.
message[RW]
payment_url[RW]
status[RW]
Public Class Methods
attribute_mapping()
click to toggle source
translates the mapping between the Recras
API and the terms used in this gem
# File lib/recras/booking.rb, line 28 def self.attribute_mapping [ ["id", "id"], ["status", "status"], ["message", "message"], ["boeking_id", "id"], ["klant_id", "customer_id"], ["payment_url", "payment_url"] ] end
new(args=nil)
click to toggle source
Initializer to transform a Hash
into an Client
object
@param [Hash] args
# File lib/recras/booking.rb, line 18 def initialize(args=nil) required_args = [] return if args.nil? args.each do |k,v| instance_variable_set("@#{k}", v) unless v.nil? end end
Public Instance Methods
make_invoice(status: 'concept')
click to toggle source
# File lib/recras/booking.rb, line 39 def make_invoice(status: 'concept') body_data = { boeking_id: id, status: status } json = client.make_request("facturen", body: body_data.to_json, http_method: :post) if json.is_a?(Hash) && json["error"] raise RecrasError.new(self), json["error"]["message"] else invoice = Recras.parse_json(json: json, endpoint: "facturen") return invoice end end