Class: Seahorse::ApiTranslator::Operation
- Inherits:
-
Object
- Object
- Seahorse::ApiTranslator::Operation
- Includes:
- Inflector
- Defined in:
- lib/seahorse/api_translator/operation.rb
Instance Attribute Summary collapse
- #method_name ⇒ String readonly
- #rules ⇒ Hash readonly
Instance Method Summary collapse
-
#initialize(rules, options = {}) ⇒ Operation
constructor
A new instance of Operation.
Methods included from Inflector
Constructor Details
#initialize(rules, options = {}) ⇒ Operation
Returns a new instance of Operation.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/seahorse/api_translator/operation.rb', line 25 def initialize rules, = {} @options = @method_name = rules['name'].sub(/\d{4}_\d{2}_\d{2}$/, '') @method_name = inflect(@method_name, @options[:inflect_method_names]) @rules = rules if @rules['http'] @rules['http'].delete('response_code') end translate_input translate_output if @options[:documentation] @rules['errors'] = @rules['errors'].map {|e| e['shape_name'] } else @rules.delete('errors') @rules.delete('documentation') @rules.delete('documentation_url') @rules.delete('response_code') end end |
Instance Attribute Details
#method_name ⇒ String (readonly)
51 52 53 |
# File 'lib/seahorse/api_translator/operation.rb', line 51 def method_name @method_name end |
#rules ⇒ Hash (readonly)
54 55 56 |
# File 'lib/seahorse/api_translator/operation.rb', line 54 def rules @rules end |