Sha256: 4c4ea6e9d712227c7cb78ff17e6517e7163e0389b789f57438f5564312a6179f

Contents?: true

Size: 403 Bytes

Versions: 10

Compression:

Stored size: 403 Bytes

Contents

class RestModel
  class Relation < Association
    autoload :Response, "rest_model/key/relation/response"
    include Response

    def initialize(name, options = {})
      super
      @has = options.fetch(:has, false)
    end

    def has?
      @has
    end

    def belongs?
      !has?
    end

    def from_source(value, resource = nil)
      nil
    end

    alias :parse  :from_source

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rest_model-0.1.11 lib/rest_model/key/relation.rb
rest_model-0.1.10 lib/rest_model/key/relation.rb
rest_model-0.1.9 lib/rest_model/key/relation.rb
rest_model-0.1.8 lib/rest_model/key/relation.rb
rest_model-0.1.7 lib/rest_model/key/relation.rb
rest_model-0.1.6 lib/rest_model/key/relation.rb
rest_model-0.1.5 lib/rest_model/key/relation.rb
rest_model-0.1.4 lib/rest_model/key/relation.rb
rest_model-0.1.3 lib/rest_model/key/relation.rb
rest_model-0.1.2 lib/rest_model/key/relation.rb