class Bidsketch::BidsketchObject

Public Class Methods

all() click to toggle source
# File lib/bidsketch/bidsketch_object.rb, line 6
def all
  Bidsketch::API.get("#{root_path}.json").map { |object| self.new(object) }
end
find(id) click to toggle source
# File lib/bidsketch/bidsketch_object.rb, line 10
def find(id)
  response = Bidsketch::API.get("#{root_path}/#{id}.json")
  self.new(response)
end
root_path() click to toggle source
# File lib/bidsketch/bidsketch_object.rb, line 15
def root_path
  class_name = self.to_s.gsub(/^.*::/, '').downcase
  "/#{class_name}s"
end