Module: Agris::Api::Grain::CommodityCodes

Included in:
Client
Defined in:
lib/agris/api/grain/commodity_codes.rb

Instance Method Summary collapse

Instance Method Details

#commodity_code(location = '', code = '') ⇒ Object



6
7
8
9
10
11
# File 'lib/agris/api/grain/commodity_codes.rb', line 6

def commodity_code(location = '', code = '')
  extract = Agris::Api::Grain::SpecificCommodityCodeExtract
            .new(location, code)

  commodity_codes([extract])
end

#commodity_codes(extracts) ⇒ Object



13
14
15
16
17
18
# File 'lib/agris/api/grain/commodity_codes.rb', line 13

def commodity_codes(extracts)
  extract_documents(
    Messages::QueryCommodityCodeDocuments.new(extracts),
    Agris::Api::Grain::Commodity
  )
end