Sha256: e1020b889e466584c2a4bed6be377da0be529bb10610c115b63bd831bbd6f238

Contents?: true

Size: 1.48 KB

Versions: 4

Compression:

Stored size: 1.48 KB

Contents

module Arbetsformedlingen
  module API
    module Values
      Ad = KeyStruct.new(
        :id,
        :url,
        :title,
        :body,
        :occupation,
        :occupation_id,
        :published_at,
        :total_vacancies,
        :municipalities,
        :municipality_id,
        :total_vacancies_with_visa,
        :employment_type,
        :terms,
        :application,
        :workplace,
        :requirements
      )
      class Ad
        def to_h
          hash = super.to_h
          hash[:terms] = hash[:terms].to_h
          hash[:application] = hash[:application].to_h
          hash[:workplace] = hash[:workplace].to_h
          hash[:requirements] = hash[:requirements].to_h
          hash
        end
      end

      Terms = KeyStruct.new(
        :duration,
        :working_hours,
        :working_hours_description,
        :salary_type,
        :salary_form
      )

      Application = KeyStruct.new(
        :reference,
        :application_url,
        :email,
        :last_application_at,
        :application_comment
      )

      Workplace = KeyStruct.new(
        :name,
        :postal,
        :country,
        :visit_address,
        :logotype_url,
        :website,
        :contacts
      )
      class Workplace
        def to_h
          data = super.to_h
          data[:postal] = data[:postal].to_h
          data
        end
      end

      Postal = KeyStruct.new(:code, :address, :city, :country)
      Requirements = KeyStruct.new(:own_car)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
arbetsformedlingen-0.5.0 lib/arbetsformedlingen/api/values/ad_result_values.rb
arbetsformedlingen-0.4.1 lib/arbetsformedlingen/api/values/ad_result_values.rb
arbetsformedlingen-0.4.0 lib/arbetsformedlingen/api/values/ad_result_values.rb
arbetsformedlingen-0.3.0 lib/arbetsformedlingen/api/values/ad_result_values.rb