Class: Mavenlink::CustomFieldValue

Inherits:
APIResource show all
Defined in:
lib/mavenlink/resources/custom_field_value.rb

Constant Summary collapse

OBJECT_NAME =
"custom_field_value"

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from APIResource

#initialize, plural_name, #refresh, resource_url, #resource_url, retrieve

Methods included from APIOperations::Request

included

Constructor Details

This class inherits a constructor from Mavenlink::APIResource

Class Method Details

.list(subject_type = nil) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/mavenlink/resources/custom_field_value.rb', line 7

def self.list(subject_type = nil)
  if subject_type.nil?
    raise ArgumentError,
          "CustomFieldValues can only be listed with a subject, " \
          "e.g. CustomFieldValue.list('user')"
  end

  super(subject_type: subject_type)
end

Instance Method Details

#subjectObject



17
18
19
20
21
22
# File 'lib/mavenlink/resources/custom_field_value.rb', line 17

def subject
  case subject_type
  when "workspace_group"
    WorkspaceGroup.retrieve(subject_id)
  end
end