Class: HaveAPI::GoClient::InputOutput
- Inherits:
-
Object
- Object
- HaveAPI::GoClient::InputOutput
- Includes:
- Utils
- Defined in:
- lib/haveapi/go_client/input_output.rb
Instance Attribute Summary collapse
- #action ⇒ Action readonly
- #direction ⇒ Symbol readonly
- #go_namespace ⇒ String readonly
- #go_type ⇒ String readonly
- #layout ⇒ String readonly
- #namespace ⇒ String readonly
- #parameters ⇒ Array<Parameter> readonly
- #role ⇒ Symbol readonly
Instance Method Summary collapse
-
#initialize(action, role, direction, desc, prefix: nil) ⇒ InputOutput
constructor
A new instance of InputOutput.
- #resolve_associations ⇒ Object
Methods included from Utils
Constructor Details
#initialize(action, role, direction, desc, prefix: nil) ⇒ InputOutput
Returns a new instance of InputOutput.
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/haveapi/go_client/input_output.rb', line 31 def initialize(action, role, direction, desc, prefix: nil) @action = action @role = role @direction = direction @layout = desc[:layout] @namespace = desc[:namespace] @parameters = desc[:parameters].map do |k, v| Parameter.new(role, direction, self, k.to_s, v) end.compact.sort! @go_type = action.go_type + (prefix || '') + direction.to_s.capitalize @go_namespace = camelize(desc[:namespace]) end |
Instance Attribute Details
#action ⇒ Action (readonly)
8 9 10 |
# File 'lib/haveapi/go_client/input_output.rb', line 8 def action @action end |
#direction ⇒ Symbol (readonly)
14 15 16 |
# File 'lib/haveapi/go_client/input_output.rb', line 14 def direction @direction end |
#go_namespace ⇒ String (readonly)
29 30 31 |
# File 'lib/haveapi/go_client/input_output.rb', line 29 def go_namespace @go_namespace end |
#go_type ⇒ String (readonly)
26 27 28 |
# File 'lib/haveapi/go_client/input_output.rb', line 26 def go_type @go_type end |
#layout ⇒ String (readonly)
17 18 19 |
# File 'lib/haveapi/go_client/input_output.rb', line 17 def layout @layout end |
#namespace ⇒ String (readonly)
20 21 22 |
# File 'lib/haveapi/go_client/input_output.rb', line 20 def namespace @namespace end |
#parameters ⇒ Array<Parameter> (readonly)
23 24 25 |
# File 'lib/haveapi/go_client/input_output.rb', line 23 def parameters @parameters end |
#role ⇒ Symbol (readonly)
11 12 13 |
# File 'lib/haveapi/go_client/input_output.rb', line 11 def role @role end |
Instance Method Details
#resolve_associations ⇒ Object
44 45 46 |
# File 'lib/haveapi/go_client/input_output.rb', line 44 def resolve_associations parameters.each(&:resolve) end |