Class: Cleantalk::Result
- Inherits:
-
Object
- Object
- Cleantalk::Result
- Defined in:
- lib/cleantalk/result.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#account_status ⇒ Object
readonly
Returns the value of attribute account_status.
-
#allow ⇒ Object
readonly
Returns the value of attribute allow.
-
#blacklisted ⇒ Object
readonly
Returns the value of attribute blacklisted.
-
#codes ⇒ Object
readonly
Returns the value of attribute codes.
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#fast_submit ⇒ Object
readonly
Returns the value of attribute fast_submit.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#inactive ⇒ Object
readonly
Returns the value of attribute inactive.
-
#js_disabled ⇒ Object
readonly
Returns the value of attribute js_disabled.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(body) ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize(body) ⇒ Result
Returns a new instance of Result.
5 6 7 8 9 10 |
# File 'lib/cleantalk/result.rb', line 5 def initialize body body = body.is_a?(String) ? JSON.parse(body) : body body.each do |meth, value| instance_variable_set("@#{meth}", value) if respond_to? meth end end |
Instance Attribute Details
#account_status ⇒ Object (readonly)
Returns the value of attribute account_status.
2 3 4 |
# File 'lib/cleantalk/result.rb', line 2 def account_status @account_status end |
#allow ⇒ Object (readonly)
Returns the value of attribute allow.
2 3 4 |
# File 'lib/cleantalk/result.rb', line 2 def allow @allow end |
#blacklisted ⇒ Object (readonly)
Returns the value of attribute blacklisted.
2 3 4 |
# File 'lib/cleantalk/result.rb', line 2 def blacklisted @blacklisted end |
#codes ⇒ Object (readonly)
Returns the value of attribute codes.
2 3 4 |
# File 'lib/cleantalk/result.rb', line 2 def codes @codes end |
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
2 3 4 |
# File 'lib/cleantalk/result.rb', line 2 def comment @comment end |
#fast_submit ⇒ Object (readonly)
Returns the value of attribute fast_submit.
2 3 4 |
# File 'lib/cleantalk/result.rb', line 2 def fast_submit @fast_submit end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
2 3 4 |
# File 'lib/cleantalk/result.rb', line 2 def id @id end |
#inactive ⇒ Object (readonly)
Returns the value of attribute inactive.
2 3 4 |
# File 'lib/cleantalk/result.rb', line 2 def inactive @inactive end |
#js_disabled ⇒ Object (readonly)
Returns the value of attribute js_disabled.
2 3 4 |
# File 'lib/cleantalk/result.rb', line 2 def js_disabled @js_disabled end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
2 3 4 |
# File 'lib/cleantalk/result.rb', line 2 def version @version end |