Sha256: 2aaaaf63100bc5fd66e21776b2add6d31a56ed888288d5b3be15887b793a0818

Contents?: true

Size: 1.08 KB

Versions: 9

Compression:

Stored size: 1.08 KB

Contents

module Cradlepoint
  class CradlepointObject

    def self.build_url(rel_url = '/')
      "#{ Cradlepoint.url_prepend }#{ Cradlepoint.base_url }#{ rel_url }"
    end

    def build_url(rel_url = '/')
      CradlepointObject.build_url(rel_url)
    end

    def self.build_new_url(rel_url = '/')
      "#{ Cradlepoint.url_prepend }#{ Cradlepoint.base_url }#{ rel_url }"
    end

    def build_new_url(rel_url = '/')
      CradlepointObject.build_new_url(rel_url)
    end

    def params
      { params: { format: :json } }
    end

    def self.successful_response?(response)
      return false unless response
      return false if response.is_a?(Hash) and !response[:success]
      true
    end

    def successful_response?(response)
      Cradlepoint::CradlepointObject.successful_response?(response)
    end

    def self.ecm_object_blob?(object_blob)
      return false unless object_blob
      return false unless object_blob.is_a?(Hash) and object_blob[:id]
      true
    end

    def ecm_object_blob?(object_blob)
      Cradlepoint::CradlepointObject.ecm_object_blob?(object_blob)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cradlepoint-0.2.7.2 lib/cradlepoint/cradlepoint_object.rb
cradlepoint-0.2.7.1 lib/cradlepoint/cradlepoint_object.rb
cradlepoint-0.2.7 lib/cradlepoint/cradlepoint_object.rb
cradlepoint-0.2.6 lib/cradlepoint/cradlepoint_object.rb
cradlepoint-0.2.5 lib/cradlepoint/cradlepoint_object.rb
cradlepoint-0.2.4 lib/cradlepoint/cradlepoint_object.rb
cradlepoint-0.2.3 lib/cradlepoint/cradlepoint_object.rb
cradlepoint-0.2.2 lib/cradlepoint/cradlepoint_object.rb
cradlepoint-0.2.1 lib/cradlepoint/cradlepoint_object.rb