Class: Nzbn::Api::IndustryClassifications
- Inherits:
-
Object
- Object
- Nzbn::Api::IndustryClassifications
- Defined in:
- lib/nzbn/api/industry_classifications.rb
Overview
Industry Classifications API
Instance Method Summary collapse
-
#create(nzbn:, classification:) ⇒ Models::IndustryClassification
Add an industry classification.
-
#initialize(client) ⇒ IndustryClassifications
constructor
A new instance of IndustryClassifications.
-
#list(nzbn:) ⇒ Array<Models::IndustryClassification>
List industry classifications for an entity.
Constructor Details
#initialize(client) ⇒ IndustryClassifications
Returns a new instance of IndustryClassifications.
7 8 9 |
# File 'lib/nzbn/api/industry_classifications.rb', line 7 def initialize(client) @client = client end |
Instance Method Details
#create(nzbn:, classification:) ⇒ Models::IndustryClassification
Add an industry classification
29 30 31 32 |
# File 'lib/nzbn/api/industry_classifications.rb', line 29 def create(nzbn:, classification:) response = @client.post("/entities/#{nzbn}/industry-classifications", classification) Models::IndustryClassification.new(response) end |
#list(nzbn:) ⇒ Array<Models::IndustryClassification>
List industry classifications for an entity
16 17 18 19 20 21 |
# File 'lib/nzbn/api/industry_classifications.rb', line 16 def list(nzbn:) response = @client.get("/entities/#{nzbn}/industry-classifications") return [] unless response.is_a?(Array) response.map { |ic| Models::IndustryClassification.new(ic) } end |