Sha256: 7fdddd28148eb84e75a02b7d247662ad2aa1039498880e3d04df45d583be4cbd

Contents?: true

Size: 1.76 KB

Versions: 15

Compression:

Stored size: 1.76 KB

Contents

#
module JSS

  #
  module ManagementHistory

    # EBook - an app deployed to a MobileDevice
    #
    # This should only be instantiated by the ManagementHistory.ebooks method
    # when mixed in to Mobile devices.
    #
    # That method will return an array of these objects.
    #
    # NOTE: some attributes will be nil for some statuses
    # (e.g. no source data if not installed)
    #
    class EBook < ImmutableStruct.new(

      :title,
      :author,
      :version,
      :kind,
      :management_status,
      :source
    )
      include JSS::ManagementHistory::HashLike

      # @!attribute [r] title
      #  @return [String] The name of the ebook.

      alias name title

      # @!attribute [r] version
      #  @return [String] The version of the ebook.

      # @!attribute [r] author
      #  @return [String] The author of the ebook.

      # @!attribute [r] kind
      #  @return [String] 'IBOOK', 'PDF', etc..

      # @!attribute [r] management_status
      #  @return [String] The raw status, used for #managed? and #status

      # @!attribute [r] source
      #  @return [Symbol] :in_house or :ibookstore

      # @return [Symbol] :installed, :pending, :failed, or :unknown
      #
      def status
        case @management_status
        when HIST_RAW_STATUS_INSTALLED then :installed
        when HIST_RAW_STATUS_MANAGED then :installed
        when HIST_RAW_STATUS_UNMANAGED then :installed
        when HIST_RAW_STATUS_PENDING then :pending
        when HIST_RAW_STATUS_FAILED then :failed
        else :unknown
        end
      end

      #  @return [Boolean] If :installed and :in_house, is it managed?
      #
      def managed?
        @management_status == HIST_RAW_STATUS_MANAGED
      end

    end # EBook

  end #   module ManagementHistory

end # module JSS

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ruby-jss-1.0.3b2 lib/jss/api_object/management_history/ebook.rb
ruby-jss-1.0.3b1 lib/jss/api_object/management_history/ebook.rb
ruby-jss-1.0.2 lib/jss/api_object/management_history/ebook.rb
ruby-jss-1.0.1 lib/jss/api_object/management_history/ebook.rb
ruby-jss-1.0.0 lib/jss/api_object/management_history/ebook.rb
ruby-jss-1.0.0b6 lib/jss/api_object/management_history/ebook.rb
ruby-jss-1.0.0b2 lib/jss/api_object/management_history/ebook.rb
ruby-jss-0.14.0 lib/jss/api_object/management_history/ebook.rb
ruby-jss-0.13.0 lib/jss/api_object/management_history/ebook.rb
ruby-jss-0.12.0 lib/jss/api_object/management_history/ebook.rb
ruby-jss-0.11.0 lib/jss/api_object/management_history/ebook.rb
ruby-jss-0.11.0b3 lib/jss/api_object/management_history/ebook.rb
ruby-jss-0.11.0b2 lib/jss/api_object/management_history/ebook.rb
ruby-jss-0.11.0b1 lib/jss/api_object/management_history/ebook.rb
ruby-jss-0.11.0a6 lib/jss/api_object/management_history/ebook.rb