Class: Wufoo::Submission::Response
- Inherits:
-
Object
- Object
- Wufoo::Submission::Response
- Defined in:
- lib/wufoo/submission.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
- #entry_id ⇒ Object
- #error ⇒ Object
- #errors ⇒ Object
- #fail? ⇒ Boolean
-
#initialize(data) ⇒ Response
constructor
A new instance of Response.
- #message ⇒ Object
- #success? ⇒ Boolean
- #valid? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ Response
Returns a new instance of Response.
23 24 25 26 |
# File 'lib/wufoo/submission.rb', line 23 def initialize(data) @data = data populate end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
21 22 23 |
# File 'lib/wufoo/submission.rb', line 21 def data @data end |
Instance Method Details
#entry_id ⇒ Object
54 55 56 |
# File 'lib/wufoo/submission.rb', line 54 def entry_id @entry_id end |
#error ⇒ Object
42 43 44 |
# File 'lib/wufoo/submission.rb', line 42 def error @error || '' end |
#errors ⇒ Object
46 47 48 |
# File 'lib/wufoo/submission.rb', line 46 def errors @errors || [] end |
#fail? ⇒ Boolean
33 34 35 36 |
# File 'lib/wufoo/submission.rb', line 33 def fail? return true if data.nil? || data == {} error.size > 0 end |
#message ⇒ Object
50 51 52 |
# File 'lib/wufoo/submission.rb', line 50 def @message || '' end |
#success? ⇒ Boolean
28 29 30 31 |
# File 'lib/wufoo/submission.rb', line 28 def success? return false if data.nil? || data == {} data['wufoo_submit'].first['success'] == 'true' end |
#valid? ⇒ Boolean
38 39 40 |
# File 'lib/wufoo/submission.rb', line 38 def valid? errors.size == 0 end |