Class: Vx::ServiceConnector::Bitbucket::Files
- Inherits:
-
Struct
- Object
- Struct
- Vx::ServiceConnector::Bitbucket::Files
- Defined in:
- lib/vx/service_connector/bitbucket/files.rb
Instance Attribute Summary collapse
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#session ⇒ Object
Returns the value of attribute session.
Instance Method Summary collapse
Instance Attribute Details
#repo ⇒ Object
Returns the value of attribute repo
6 7 8 |
# File 'lib/vx/service_connector/bitbucket/files.rb', line 6 def repo @repo end |
#session ⇒ Object
Returns the value of attribute session
6 7 8 |
# File 'lib/vx/service_connector/bitbucket/files.rb', line 6 def session @session end |
Instance Method Details
#get(sha, path) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/vx/service_connector/bitbucket/files.rb', line 8 def get(sha, path) begin re = session.get("api/1.0/repositories/#{repo.full_name}/src/#{sha}/#{path}") # TODO: check and remove source re && (re['source'] || re['data']) rescue RequestError => e $stderr.puts "ERROR: #{e.inspect}" nil end end |