Class: HaveAPI::GoClient::Parameters::Association
- Inherits:
-
Object
- Object
- HaveAPI::GoClient::Parameters::Association
show all
- Includes:
- Utils
- Defined in:
- lib/haveapi/go_client/parameters/association.rb
Constant Summary
Constants included
from Utils
Utils::GO_KEYWORDS
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Utils
#camelize, #go_comment_text, #go_json_tag, #go_module_path, #go_package_name, #go_query_key, #go_string_literal, #safe_file_component
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_type ⇒ String
11
12
13
|
# File 'lib/haveapi/go_client/parameters/association.rb', line 11
def go_type
@go_type
end
|
#go_value_id ⇒ String
14
15
16
|
# File 'lib/haveapi/go_client/parameters/association.rb', line 14
def go_value_id
@go_value_id
end
|
#go_value_label ⇒ String
17
18
19
|
# File 'lib/haveapi/go_client/parameters/association.rb', line 17
def go_value_label
@go_value_label
end
|
8
9
10
|
# File 'lib/haveapi/go_client/parameters/association.rb', line 8
def parameter
@parameter
end
|
20
21
22
|
# File 'lib/haveapi/go_client/parameters/association.rb', line 20
def resource
@resource
end
|