Class: GitWand::GitHub::Resource::File
- Inherits:
-
Object
- Object
- GitWand::GitHub::Resource::File
- Defined in:
- lib/git_wand/github/resource/file.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#html_url ⇒ Object
Returns the value of attribute html_url.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#sha ⇒ Object
Returns the value of attribute sha.
-
#size ⇒ Object
Returns the value of attribute size.
Class Method Summary collapse
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
7 8 9 |
# File 'lib/git_wand/github/resource/file.rb', line 7 def content @content end |
#html_url ⇒ Object
Returns the value of attribute html_url.
7 8 9 |
# File 'lib/git_wand/github/resource/file.rb', line 7 def html_url @html_url end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/git_wand/github/resource/file.rb', line 7 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
7 8 9 |
# File 'lib/git_wand/github/resource/file.rb', line 7 def path @path end |
#sha ⇒ Object
Returns the value of attribute sha.
7 8 9 |
# File 'lib/git_wand/github/resource/file.rb', line 7 def sha @sha end |
#size ⇒ Object
Returns the value of attribute size.
7 8 9 |
# File 'lib/git_wand/github/resource/file.rb', line 7 def size @size end |
Class Method Details
.build_from_api_result(result) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/git_wand/github/resource/file.rb', line 9 def self.build_from_api_result(result) return unless result.success? resource = new resource.name = result.body["name"] resource.path = result.body["path"] resource.sha = result.body["sha"] resource.size = result.body["size"] resource.html_url = result.body["html_url"] resource.content = Base64::decode64(result.body["content"]) resource end |