Class: SmokeyBear::Helpers::ResponseDelegate

Inherits:
RestClient::Response
  • Object
show all
Defined in:
lib/smokey_bear/helpers.rb

Instance Method Summary collapse

Instance Method Details

#has_status?(expected_code) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/smokey_bear/helpers.rb', line 11

def has_status?(expected_code)
  code == expected_code
end

#json?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/smokey_bear/helpers.rb', line 15

def json?
  headers[:content_type] =~ /\bjson\b/
end