Class: Kashflow::ApiMethod
- Inherits:
-
Object
- Object
- Kashflow::ApiMethod
- Defined in:
- lib/kashflow/api_method.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#request_attrs ⇒ Object
Returns the value of attribute request_attrs.
-
#response_attrs ⇒ Object
Returns the value of attribute response_attrs.
Instance Method Summary collapse
-
#initialize(name, fields) ⇒ ApiMethod
constructor
A new instance of ApiMethod.
Constructor Details
#initialize(name, fields) ⇒ ApiMethod
Returns a new instance of ApiMethod.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/kashflow/api_method.rb', line 5 def initialize(name, fields) @name = name # split into request/response attrs @request_attrs, @response_attrs = fields.partition{|f| f[:direction] == 'IN' }.map do |arr| arr.map do |fields| # get rid of the :direction and cleanup the description text fields.slice!(:type, :desc, :name) fields[:desc].try(:strip!) fields end end end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/kashflow/api_method.rb', line 3 def name @name end |
#request_attrs ⇒ Object
Returns the value of attribute request_attrs.
3 4 5 |
# File 'lib/kashflow/api_method.rb', line 3 def request_attrs @request_attrs end |
#response_attrs ⇒ Object
Returns the value of attribute response_attrs.
3 4 5 |
# File 'lib/kashflow/api_method.rb', line 3 def response_attrs @response_attrs end |