Class: Rushover::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Response

Returns a new instance of Response.



89
90
91
# File 'lib/rushover.rb', line 89

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



87
88
89
# File 'lib/rushover.rb', line 87

def data
  @data
end

Instance Method Details

#[](key) ⇒ Object



93
94
95
# File 'lib/rushover.rb', line 93

def [](key)
  @data[key.to_s]
end

#inspectObject



101
102
103
# File 'lib/rushover.rb', line 101

def inspect
  @data.inspect
end

#ok?Boolean

Returns:

  • (Boolean)


97
98
99
# File 'lib/rushover.rb', line 97

def ok?
  self["status"].to_i == 1
end

#to_hObject



109
110
111
# File 'lib/rushover.rb', line 109

def to_h
  @data.dup
end

#to_sObject



105
106
107
# File 'lib/rushover.rb', line 105

def to_s
  @data.to_s
end