Sha256: 03a8225e46fe7a038f891384140799208b881a66295ec492864036d77c2bee10

Contents?: true

Size: 670 Bytes

Versions: 5

Compression:

Stored size: 670 Bytes

Contents

require_relative 'client'
require_relative '../../lib/check_mobi/shared/class_with_attributes'

module CheckMobi
  class Resource
    include ClassWithAttributes

    def perform
      before_perform
      client.perform
    end

    def client
      Client.new(defaults)
    end

    private

    ALLOWED_METHODS = Client::ALLOWED_METHODS

    def after_initialize
      @platform ||= CheckMobi::Configuration::DEFAULT_PLATFORM if instance_variable_defined?(:@platform)
    end

    def defaults
      {
          rel_path: nil,
          http_method: nil,
          form_data: nil
      }
    end

    def before_perform  # overridden by subclasses

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
check_mobi-1.0.5 lib/check_mobi/resource.rb
check_mobi-1.0.4 lib/check_mobi/resource.rb
check_mobi-1.0.3 lib/check_mobi/resource.rb
check_mobi-1.0.2 lib/check_mobi/resource.rb
check_mobi-1.0.1 lib/check_mobi/resource.rb