Class: Recras::CombinationItem

Inherits:
Object
  • Object
show all
Extended by:
Recras
Defined in:
lib/recras/combination_item.rb

Overview

links to ‘arrangement_regels’ in the API recras.github.io/docs/endpoints/arrangementen.html

Constant Summary

Constants included from Recras

API_VERSION, VERSION

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Recras

make_request, new_from_json, object_mappings, parse_json, url, version

Constructor Details

#initialize(args = nil) ⇒ CombinationItem

Initializer to transform a Hash into an Client object

Parameters:

  • args (Hash) (defaults to: nil)


23
24
25
26
27
28
29
30
# File 'lib/recras/combination_item.rb', line 23

def initialize(args=nil)
  required_args = []
  return if args.nil?
  args.each do |k,v|
    instance_variable_set("@#{k}", v) unless v.nil?
  end
  set_values_from_json
end

Instance Attribute Details

#begins_atObject

Returns the value of attribute begins_at.



11
12
13
# File 'lib/recras/combination_item.rb', line 11

def begins_at
  @begins_at
end

#descriptionObject

Returns the value of attribute description.



14
15
16
# File 'lib/recras/combination_item.rb', line 14

def description
  @description
end

#ends_atObject

Returns the value of attribute ends_at.



12
13
14
# File 'lib/recras/combination_item.rb', line 12

def ends_at
  @ends_at
end

#idObject

Note:

The is a required parameter.



9
10
11
# File 'lib/recras/combination_item.rb', line 9

def id
  @id
end

#jsonObject

Returns the value of attribute json.



19
20
21
# File 'lib/recras/combination_item.rb', line 19

def json
  @json
end

#location_idObject

Returns the value of attribute location_id.



10
11
12
# File 'lib/recras/combination_item.rb', line 10

def location_id
  @location_id
end

#minimumObject

Returns the value of attribute minimum.



18
19
20
# File 'lib/recras/combination_item.rb', line 18

def minimum
  @minimum
end

#nameObject

Returns the value of attribute name.



13
14
15
# File 'lib/recras/combination_item.rb', line 13

def name
  @name
end

#number_of_peopleObject

Returns the value of attribute number_of_people.



15
16
17
# File 'lib/recras/combination_item.rb', line 15

def number_of_people
  @number_of_people
end

#priceObject

Returns the value of attribute price.



17
18
19
# File 'lib/recras/combination_item.rb', line 17

def price
  @price
end

#product_idObject

Returns the value of attribute product_id.



16
17
18
# File 'lib/recras/combination_item.rb', line 16

def product_id
  @product_id
end

Class Method Details

.attribute_mappingObject

translates the mapping between the Recras API and the terms used in this gem



38
39
40
# File 'lib/recras/combination_item.rb', line 38

def self.attribute_mapping
  [["id", "id"],["locatie_id", "location_id"],["begin", "begins_at@@time"],["eind", "ends_at@@time"], ["beschrijving", "description"], ["verkoop", "price@@float"], ["aantal_personen", "number_of_people"], ["product_id", "product_id"]]
end

.plural_nameObject



32
33
34
# File 'lib/recras/combination_item.rb', line 32

def self.plural_name
  "combination_items"
end