Class: StatHat::Response

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

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ Response

Returns a new instance of Response.



183
184
185
186
# File 'lib/stathat.rb', line 183

def initialize(body)
        @body = body
        @parsed = nil
end

Instance Method Details

#msgObject



197
198
199
200
# File 'lib/stathat.rb', line 197

def msg
        parse
        return @parsed['msg']
end

#statusObject



192
193
194
195
# File 'lib/stathat.rb', line 192

def status
        parse
        return @parsed['status']
end

#valid?Boolean

Returns:

  • (Boolean)


188
189
190
# File 'lib/stathat.rb', line 188

def valid?
        return status == 200
end