Class: HaveAPI::GoClient::Parameters::Association

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/haveapi/go_client/parameters/association.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#camelize

Constructor Details

#initialize(param, desc) ⇒ Association

Returns a new instance of Association.



22
23
24
25
26
27
28
# File 'lib/haveapi/go_client/parameters/association.rb', line 22

def initialize(param, desc)
  @parameter = param
  @resource = find_resource(desc[:resource])
  @go_type = resource.actions.detect { |a| a.name == 'show' }.output.go_type
  @go_value_id = camelize(desc[:value_id])
  @go_value_label = camelize(desc[:value_label])
end

Instance Attribute Details

#go_typeString (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/haveapi/go_client/parameters/association.rb', line 11

def go_type
  @go_type
end

#go_value_idString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/haveapi/go_client/parameters/association.rb', line 14

def go_value_id
  @go_value_id
end

#go_value_labelString (readonly)

Returns:

  • (String)


17
18
19
# File 'lib/haveapi/go_client/parameters/association.rb', line 17

def go_value_label
  @go_value_label
end

#parameterParameter (readonly)

Returns:



8
9
10
# File 'lib/haveapi/go_client/parameters/association.rb', line 8

def parameter
  @parameter
end

#resourceResource (readonly)

Returns:



20
21
22
# File 'lib/haveapi/go_client/parameters/association.rb', line 20

def resource
  @resource
end