Class: Octopi::Blob

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

Constant Summary

Constant Summary

Constants inherited from Base

Octopi::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

- (Object) data

Returns the value of attribute data



4
5
6
# File 'lib/octopi/blob.rb', line 4

def data
  @data
end

- (Object) mime_type

Returns the value of attribute mime_type



4
5
6
# File 'lib/octopi/blob.rb', line 4

def mime_type
  @mime_type
end

- (Object) mode

Returns the value of attribute mode



4
5
6
# File 'lib/octopi/blob.rb', line 4

def mode
  @mode
end

- (Object) name

Returns the value of attribute name



4
5
6
# File 'lib/octopi/blob.rb', line 4

def name
  @name
end

- (Object) sha

Returns the value of attribute sha



4
5
6
# File 'lib/octopi/blob.rb', line 4

def sha
  @sha
end

- (Object) size

Returns the value of attribute size



4
5
6
# File 'lib/octopi/blob.rb', line 4

def size
  @size
end

- (Object) text

Returns the value of attribute text



4
5
6
# File 'lib/octopi/blob.rb', line 4

def text
  @text
end

Class Method Details

+ (Object) find(options = {})



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/octopi/blob.rb', line 10

def self.find(options={})
  ensure_hash(options)
  user, repo = gather_details(options)
  sha = options[:sha]
  path = options[:path]
  
  self.validate_args(sha => :sha, user => :user)
  
  if path
    super [user, repo, sha, path]
  else
    Api.api.get_raw(path_for(:resource), {:id => [user, repo, sha].join('/')})
  end  
end