class ActiveShotgun::Client

Constants

CONNECTION_TYPES
READ_ONLY_TYPES

Attributes

shotgun[R]

Public Class Methods

new() click to toggle source
# File lib/active_shotgun/client.rb, line 14
def initialize
  @shotgun = ShotgunApiRuby.new(
    shotgun_site: Config.shotgun_site_name || Config.shotgun_site_url,
    auth: { client_id: Config.shotgun_client_id, client_secret: Config.shotgun_client_secret }
  )
end

Public Instance Methods

fetch_field_names_for_an_entity_type(type) click to toggle source
# File lib/active_shotgun/client.rb, line 32
def fetch_field_names_for_an_entity_type(type)
  result = shotgun.entities(type).fields.to_h
  {
    writable: result.reject do |_, v|
      (CONNECTION_TYPES + READ_ONLY_TYPES).include?(v.data_type) ||
        !v.editable
    end.keys,
    readable: result.reject{ |_, v| CONNECTION_TYPES.include?(v.data_type) }.keys,
  }
end