Sha256: 6a8dcd163426120f5e88c05c6ca1b718fbfbd952842d3f448f7a72aef50525f8

Contents?: true

Size: 702 Bytes

Versions: 14

Compression:

Stored size: 702 Bytes

Contents

module TMS #:nodoc:
  module Base
    def self.included(base)
      base.send(:include, TMS::Util::HalLinkParser)
      base.extend(ClassMethods)
      base.send(:include, InstanceMethods)
      base.send(:include, TMS::CoreExt)
      base.send(:extend, TMS::CoreExt)
    end

    attr_accessor :client, :href, :errors, :new_record

    module ClassMethods
      def to_param
        tmsify(self)
      end
    end

    module InstanceMethods
      def initialize(client, href)
        self.client = client
        self.href = href
      end

      def new_record?
        !!self.new_record
      end

      def href=(href)
        self.new_record=false
        @href=href
      end
    end

  end

end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
govdelivery-tms-0.8.0 lib/govdelivery-tms/base.rb
tms_client-0.6.0 lib/tms_client/base.rb
tms_client-0.5.4 lib/tms_client/base.rb
tms_client-0.5.3 lib/tms_client/base.rb
tms_client-0.5.2 lib/tms_client/base.rb
tms_client-0.5.1 lib/tms_client/base.rb
tms_client-0.4.1 lib/tms_client/base.rb
tms_client-0.4.0 lib/tms_client/base.rb
tms_client-0.3.0 lib/tms_client/base.rb
tms_client-0.2.2 lib/tms_client/base.rb
tms_client-0.2.1 lib/tms_client/base.rb
tms_client-0.2.0 lib/tms_client/base.rb
tms_client-0.1.1 lib/tms_client/base.rb
tms_client-0.1.0 lib/tms_client/base.rb