Class: HaveAPI::GoClient::Parameters::Association
- Inherits:
-
Object
- Object
- HaveAPI::GoClient::Parameters::Association
- Includes:
- Utils
- Defined in:
- lib/haveapi/go_client/parameters/association.rb
Instance Attribute Summary collapse
- #go_type ⇒ String readonly
- #go_value_id ⇒ String readonly
- #go_value_label ⇒ String readonly
- #parameter ⇒ Parameter readonly
- #resource ⇒ Resource readonly
Instance Method Summary collapse
-
#initialize(param, desc) ⇒ Association
constructor
A new instance of Association.
Methods included from Utils
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 (readonly)
11 12 13 |
# File 'lib/haveapi/go_client/parameters/association.rb', line 11 def go_type @go_type end |
#go_value_id ⇒ String (readonly)
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 (readonly)
17 18 19 |
# File 'lib/haveapi/go_client/parameters/association.rb', line 17 def go_value_label @go_value_label end |
#parameter ⇒ Parameter (readonly)
8 9 10 |
# File 'lib/haveapi/go_client/parameters/association.rb', line 8 def parameter @parameter end |
#resource ⇒ Resource (readonly)
20 21 22 |
# File 'lib/haveapi/go_client/parameters/association.rb', line 20 def resource @resource end |