Sha256: 493bc9cb430d3f750e69b72e60c4c92e46ba138702505ab39eb2c07d956bf6f3

Contents?: true

Size: 632 Bytes

Versions: 1

Compression:

Stored size: 632 Bytes

Contents

require 'active_support/core_ext/string/inflections'
require 'active_support/core_ext/module/delegation'

module Travis
  class Model
    autoload :Artifact,    'travis/model/artifact'
    autoload :Build,       'travis/model/build'
    autoload :Job,         'travis/model/job'
    autoload :Request,     'travis/model/request'
    autoload :ServiceHook, 'travis/model/service_hook'

    class << self
      def find(id)
        new(self.class.name.demodulize.constantize.find(id))
      end
    end

    delegate :save!, :to => :record

    attr_reader :record

    def initialize(record)
      @record = record
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
travis-core-0.0.1 lib/travis/model.rb