Class: Arbetsformedlingen::API::Values::CreateAdPage

Inherits:
Object
  • Object
show all
Defined in:
lib/arbetsformedlingen/api/values/create_ad_page.rb

Constant Summary collapse

ResponseMessage =
KeyStruct.new(:detail, :error_code)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(httparty_response, _request_boby) ⇒ CreateAdPage

Returns a new instance of CreateAdPage.



11
12
13
14
15
16
17
# File 'lib/arbetsformedlingen/api/values/create_ad_page.rb', line 11

def initialize(httparty_response, _request_boby)
  @code = httparty_response.code
  @body = httparty_response.body
  @request_body = request_body
  @valid = @code == 202
  @messages = build_messages(httparty_response.to_a)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



9
10
11
# File 'lib/arbetsformedlingen/api/values/create_ad_page.rb', line 9

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



9
10
11
# File 'lib/arbetsformedlingen/api/values/create_ad_page.rb', line 9

def code
  @code
end

#messagesObject (readonly)

Returns the value of attribute messages.



9
10
11
# File 'lib/arbetsformedlingen/api/values/create_ad_page.rb', line 9

def messages
  @messages
end

#request_bodyObject (readonly)

Returns the value of attribute request_body.



9
10
11
# File 'lib/arbetsformedlingen/api/values/create_ad_page.rb', line 9

def request_body
  @request_body
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/arbetsformedlingen/api/values/create_ad_page.rb', line 19

def valid?
  @valid
end