Sha256: 95df505a9e9b5a61d7cc5d3d343bd4da19565211cdbabb0ce56c1963f0d38c5d

Contents?: true

Size: 402 Bytes

Versions: 15

Compression:

Stored size: 402 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

15 entries across 15 versions & 1 rubygems

Version Path
rest_model-0.2.1 lib/rest_model/key/relation.rb
rest_model-0.2.0 lib/rest_model/key/relation.rb
rest_model-0.1.24 lib/rest_model/key/relation.rb
rest_model-0.1.23 lib/rest_model/key/relation.rb
rest_model-0.1.22 lib/rest_model/key/relation.rb
rest_model-0.1.21 lib/rest_model/key/relation.rb
rest_model-0.1.20 lib/rest_model/key/relation.rb
rest_model-0.1.19 lib/rest_model/key/relation.rb
rest_model-0.1.18 lib/rest_model/key/relation.rb
rest_model-0.1.17 lib/rest_model/key/relation.rb
rest_model-0.1.16 lib/rest_model/key/relation.rb
rest_model-0.1.15 lib/rest_model/key/relation.rb
rest_model-0.1.14 lib/rest_model/key/relation.rb
rest_model-0.1.13 lib/rest_model/key/relation.rb
rest_model-0.1.12 lib/rest_model/key/relation.rb