module ActiveGist::Attributes
Constants
- GIST_ATTRIBUTES
Attributes
comments[R]
comments_url[R]
commits_url[R]
created_at[R]
description[R]
files[R]
forks[R]
forks_url[R]
git_pull_url[R]
git_push_url[R]
history[R]
html_url[R]
id[R]
updated_at[R]
url[R]
user[R]
Public Instance Methods
[](attribute)
click to toggle source
# File lib/active_gist/attributes.rb, line 65 def [](attribute) send attribute.to_sym end
[]=(attribute, value)
click to toggle source
# File lib/active_gist/attributes.rb, line 69 def []=(attribute, value) send :"#{attribute}=", value end
attributes()
click to toggle source
# File lib/active_gist/attributes.rb, line 47 def attributes GIST_ATTRIBUTES.inject({}) { |h,k| h[k] = self[k]; h } end
attributes=(attributes)
click to toggle source
# File lib/active_gist/attributes.rb, line 51 def attributes=(attributes) attributes.each do |key, value| if respond_to?(:"#{key}=") send :"#{key}=", value else if GIST_ATTRIBUTES.include?(key.to_s) instance_variable_set :"@#{key}", value else raise ArgumentError, "Unknown attribute #{key.inspect}; expected one of #{GIST_ATTRIBUTES.inspect}" end end end end
description=(descr)
click to toggle source
# File lib/active_gist/attributes.rb, line 32 def description=(descr) description_will_change! @description = descr end
files=(files)
click to toggle source
# File lib/active_gist/attributes.rb, line 42 def files=(files) files_will_change! @files = files end
public=(pub)
click to toggle source
# File lib/active_gist/attributes.rb, line 37 def public=(pub) public_will_change! @public = pub end
public?()
click to toggle source
# File lib/active_gist/attributes.rb, line 27 def public? !!@public end
Also aliased as: public