Class: Octopi::Gist

Inherits:
Base
  • Object
show all
Includes:
HTTParty, Resource
Defined in:
lib/octopi/gist.rb

Overview

Gist API is… lacking at the moment. This class serves only as a reminder to implement it later

Constant Summary

Constants inherited from Base

Base::VALID

Instance Attribute Summary collapse

Attributes inherited from Base

#api

Class Method Summary collapse

Methods included from Resource

for, included

Methods inherited from Base

#error=, #initialize, #property, #save

Constructor Details

This class inherits a constructor from Octopi::Base

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



6
7
8
# File 'lib/octopi/gist.rb', line 6

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'lib/octopi/gist.rb', line 6

def description
  @description
end

#publicObject

Returns the value of attribute public.



6
7
8
# File 'lib/octopi/gist.rb', line 6

def public
  @public
end

#repoObject

Returns the value of attribute repo.



6
7
8
# File 'lib/octopi/gist.rb', line 6

def repo
  @repo
end

Class Method Details

.base_uriObject



12
13
14
# File 'lib/octopi/gist.rb', line 12

def self.base_uri
  "https://gist.github.com/api/v1/yaml"
end

.find(id) ⇒ Object



16
17
18
19
20
# File 'lib/octopi/gist.rb', line 16

def self.find(id)
  result = get("#{base_uri}/#{id}")
  # This returns an array of Gists, rather than a single record.
  new(result["gists"].first)
end