Class: CreateResponse
- Defined in:
- lib/dto/posting/create_response.rb
Overview
Class CreateResponse represents server response on create
Posting API request. Server response is sent to from_array
method which creates objects with attributes postKey
, error
accessible via getters:
response = RangeResponse.from_array(...)
response.postKey # => String
response.post_key # => String
response.error # => String
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#postKey ⇒ Object
Returns the value of attribute postKey.
Class Method Summary collapse
-
.from_array(array) ⇒ Object
Method
from_array
creates an array of CreateResponse objects from a given array of JSON hashes.
Methods inherited from Struct
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error
10 11 12 |
# File 'lib/dto/posting/create_response.rb', line 10 def error @error end |
#errors ⇒ Object
Returns the value of attribute errors
10 11 12 |
# File 'lib/dto/posting/create_response.rb', line 10 def errors @errors end |
#postKey ⇒ Object
Returns the value of attribute postKey
10 11 12 |
# File 'lib/dto/posting/create_response.rb', line 10 def postKey @postKey end |
Class Method Details
.from_array(array) ⇒ Object
Method from_array
creates an array of CreateResponse objects from a given array of JSON hashes.
18 19 20 21 22 |
# File 'lib/dto/posting/create_response.rb', line 18 def self.from_array(array) array.collect do |element| CreateResponse.from_hash(element) end end |