Class: GithubApi::Blob

Inherits:
Object
  • Object
show all
Defined in:
lib/github-api/other.rb

Overview

Blob class


Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Blob

Returns a new instance of Blob.



83
84
85
86
# File 'lib/github-api/other.rb', line 83

def initialize(attributes={}) 
  @encoding = "utf-8"
  attributes.each { |key, val| send("#{key}=", val) if respond_to?("#{key}=") }
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



81
82
83
# File 'lib/github-api/other.rb', line 81

def content
  @content
end

#encodingObject

Returns the value of attribute encoding.



81
82
83
# File 'lib/github-api/other.rb', line 81

def encoding
  @encoding
end

#pathObject

Returns the value of attribute path.



81
82
83
# File 'lib/github-api/other.rb', line 81

def path
  @path
end

Instance Method Details

#to_hashObject



88
89
90
91
92
93
94
95
# File 'lib/github-api/other.rb', line 88

def to_hash
  {
    :type => "blob",
    :path => @path,
    :content => @content,
    :encoding => @encoding
  }
end