class Lurch::Relationship::Linked

Public Class Methods

new(store, relationship_key, document) click to toggle source
# File lib/lurch/relationship/linked.rb, line 4
def initialize(store, relationship_key, document)
  @store = store
  @relationship_key = relationship_key
  @href = document["links"]["related"]
end

Public Instance Methods

fetch() click to toggle source
# File lib/lurch/relationship/linked.rb, line 10
def fetch
  @data = @store.load_from_url(@href)
end
inspect() click to toggle source

def filter(*args)

@store.query.link(@href).filter(*args)

end

def include(*args)

@store.query.link(@href).include(*args)

end

def fields(*args)

@store.query.link(@href).fields(*args)

end

def sort(*args)

@store.query.link(@href).sort(*args)

end

def page(*args)

@store.query.link(@href).page(*args)

end

# File lib/lurch/relationship/linked.rb, line 34
def inspect
  suffix = loaded? ? " \"loaded\"" : ""
  "#<#{self.class} href: #{@href.inspect}#{suffix}>"
end