Sha256: c120f784ba19df52c3c6ce358d8a713950f3e4baba9ac02be6aa34685565bd8f

Contents?: true

Size: 398 Bytes

Versions: 8

Compression:

Stored size: 398 Bytes

Contents

module EveOnline
  class EventResponseObject
    STATUSES = { 'Undecided' => :undecided, 'Accepted' => :accepted,
                 'Declined' => :declined, 'Tentative' => :tentative }.freeze

    attr_reader :input

    def initialize(input)
      @input = input
    end

    def value
      raise ArgumentError unless STATUSES.key?(input)

      @value ||= STATUSES.fetch(input)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
eve_online-0.14.0 lib/eve_online/event_response_object.rb
eve_online-0.13.0 lib/eve_online/event_response_object.rb
eve_online-0.12.0 lib/eve_online/event_response_object.rb
eve_online-0.11.0 lib/eve_online/event_response_object.rb
eve_online-0.10.0 lib/eve_online/event_response_object.rb
eve_online-0.9.0 lib/eve_online/event_response_object.rb
eve_online-0.8.0 lib/eve_online/event_response_object.rb
eve_online-0.7.0 lib/eve_online/event_response_object.rb