Class: Uktt::Section
- Inherits:
-
Object
- Object
- Uktt::Section
- Defined in:
- lib/uktt/section.rb
Overview
A Section object for dealing with an API resource
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#section_id ⇒ Object
Returns the value of attribute section_id.
Instance Method Summary collapse
- #goods_nomenclatures ⇒ Object
-
#initialize(opts = {}) ⇒ Section
constructor
A new instance of Section.
- #note ⇒ Object
- #retrieve ⇒ Object
- #retrieve_all ⇒ Object
Constructor Details
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
4 5 6 |
# File 'lib/uktt/section.rb', line 4 def config @config end |
#section_id ⇒ Object
Returns the value of attribute section_id.
4 5 6 |
# File 'lib/uktt/section.rb', line 4 def section_id @section_id end |
Instance Method Details
#goods_nomenclatures ⇒ Object
22 23 24 25 26 |
# File 'lib/uktt/section.rb', line 22 def goods_nomenclatures return '@section_id cannot be nil' if @section_id.nil? fetch "#{GOODS_NOMENCLATURE}/section/#{@section_id}.json" end |
#note ⇒ Object
28 29 30 31 32 |
# File 'lib/uktt/section.rb', line 28 def note return '@section_id cannot be nil' if @section_id.nil? fetch "#{SECTION}/#{@section_id}/section_note.json" end |
#retrieve ⇒ Object
12 13 14 15 16 |
# File 'lib/uktt/section.rb', line 12 def retrieve return '@section_id cannot be nil' if @section_id.nil? fetch "#{SECTION}/#{@section_id}.json" end |
#retrieve_all ⇒ Object
18 19 20 |
# File 'lib/uktt/section.rb', line 18 def retrieve_all fetch "#{SECTION}.json" end |