Class: Cleantalk::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/cleantalk/result.rb

Direct Known Subclasses

CheckMessageResult, CheckNewuserResult

Instance Attribute Summary collapse

Instance Method Summary collapse

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_statusObject (readonly)

Returns the value of attribute account_status.



2
3
4
# File 'lib/cleantalk/result.rb', line 2

def 
  @account_status
end

#allowObject (readonly)

Returns the value of attribute allow.



2
3
4
# File 'lib/cleantalk/result.rb', line 2

def allow
  @allow
end

#blacklistedObject (readonly)

Returns the value of attribute blacklisted.



2
3
4
# File 'lib/cleantalk/result.rb', line 2

def blacklisted
  @blacklisted
end

#codesObject (readonly)

Returns the value of attribute codes.



2
3
4
# File 'lib/cleantalk/result.rb', line 2

def codes
  @codes
end

#commentObject (readonly)

Returns the value of attribute comment.



2
3
4
# File 'lib/cleantalk/result.rb', line 2

def comment
  @comment
end

#fast_submitObject (readonly)

Returns the value of attribute fast_submit.



2
3
4
# File 'lib/cleantalk/result.rb', line 2

def fast_submit
  @fast_submit
end

#idObject (readonly)

Returns the value of attribute id.



2
3
4
# File 'lib/cleantalk/result.rb', line 2

def id
  @id
end

#inactiveObject (readonly)

Returns the value of attribute inactive.



2
3
4
# File 'lib/cleantalk/result.rb', line 2

def inactive
  @inactive
end

#js_disabledObject (readonly)

Returns the value of attribute js_disabled.



2
3
4
# File 'lib/cleantalk/result.rb', line 2

def js_disabled
  @js_disabled
end

#versionObject (readonly)

Returns the value of attribute version.



2
3
4
# File 'lib/cleantalk/result.rb', line 2

def version
  @version
end