Sha256: 5ed9d8efa808263bc3053826938a45a74a3f6333e980d0b6287218150f7352a5

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

# encoding: utf-8
module Jiralicious
  ##
  # The CustomFieldOption provides a list of available custom
  # field options. This method is used in lazy loading and can
  # be used to validate options prior to updating the issue.
  #
  class CustomFieldOption < Jiralicious::Base

    ##
    # Initialization Method
    #
    # [Arguments]
    # :decoded_json    (optional)    rubyized json object
    #
    def initialize(decoded_json)
      @loaded = false
      if decoded_json.is_a? Hash
        properties_from_hash(decoded_json)
        super(decoded_json)
        parse!(decoded_json)
        @loaded = true
      end
    end

    class << self
      ##
      # Overrides the auto-generated endpoint_name from Base.
      # This is necessary due to lower camel case naming convention.
      #
      def endpoint_name
        "customFieldOption"
      end

      ##
      # Retrieves the options based on the ID
      #
      def find(id, options = {})
        response = fetch({:key => id})
        response.parsed_response['id'] = id
        new(response.parsed_response)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jiralicious-0.5.0 lib/jiralicious/custom_field_option.rb