Class: Slodd::Github

Inherits:
Object
  • Object
show all
Defined in:
lib/slodd/github.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ Github

Returns a new instance of Github.



8
9
10
11
12
13
14
# File 'lib/slodd/github.rb', line 8

def initialize(attrs)
  self.owner = attrs.fetch(:owner)
  self.repo  = attrs.fetch(:repo)
  self.token = attrs.fetch(:token)
  self.path  = attrs.fetch(:path)
  self.ref   = attrs[:ref]
end

Instance Attribute Details

#ownerObject

Returns the value of attribute owner.



6
7
8
# File 'lib/slodd/github.rb', line 6

def owner
  @owner
end

#pathObject

Returns the value of attribute path.



6
7
8
# File 'lib/slodd/github.rb', line 6

def path
  @path
end

#refObject

Returns the value of attribute ref.



6
7
8
# File 'lib/slodd/github.rb', line 6

def ref
  @ref
end

#repoObject

Returns the value of attribute repo.



6
7
8
# File 'lib/slodd/github.rb', line 6

def repo
  @repo
end

#tokenObject

Returns the value of attribute token.



6
7
8
# File 'lib/slodd/github.rb', line 6

def token
  @token
end

Instance Method Details

#schemaObject



16
17
18
# File 'lib/slodd/github.rb', line 16

def schema
  @schema ||= open(url, headers).read
end