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