Module: Zotero::Fields

Included in:
Client
Defined in:
lib/zotero/fields.rb

Overview

Field discovery methods for Zotero items and creators

Instance Method Summary collapse

Instance Method Details

#build_locale_params(locale) ⇒ Object (private)



26
27
28
# File 'lib/zotero/fields.rb', line 26

def build_locale_params(locale)
  locale ? { locale: locale } : {}
end

#creator_fields(locale: nil) ⇒ Array<Hash>

Get all available creator fields.

Parameters:

  • locale (String) (defaults to: nil)

    Optional locale for localized field names (e.g. 'en-US', 'fr-FR')

Returns:

  • (Array<Hash>)

    Array of creator field definitions with field names and localized labels



19
20
21
22
# File 'lib/zotero/fields.rb', line 19

def creator_fields(locale: nil)
  params = build_locale_params(locale)
  make_get_request("/creatorFields", params: params)
end

#item_fields(locale: nil) ⇒ Array<Hash>

Get all available item fields.

Parameters:

  • locale (String) (defaults to: nil)

    Optional locale for localized field names (e.g. 'en-US', 'fr-FR')

Returns:

  • (Array<Hash>)

    Array of field definitions with field names and localized labels



10
11
12
13
# File 'lib/zotero/fields.rb', line 10

def item_fields(locale: nil)
  params = build_locale_params(locale)
  make_get_request("/itemFields", params: params)
end