lib/inch/code_object/proxy/base.rb in inch-0.4.10 vs lib/inch/code_object/proxy/base.rb in inch-0.5.0.rc1
- old
+ new
@@ -1,6 +1,6 @@
-require "forwardable"
+require 'forwardable'
module Inch
module CodeObject
module Proxy
# This is the base class for code object proxies.
@@ -40,24 +40,23 @@
@evaluation ||= Evaluation::Proxy.for(self)
end
# @return [Symbol]
def grade
- @grade ||= Evaluation.new_grade_lists.find do |range|
- range.scores.include?(score)
- end.grade
+ @grade ||= Evaluation.new_grade_lists.detect { |range|
+ range.scores.include?(score)
+ }.grade
end
# @return [Boolean] if the current object is an alias for something else
def alias?
!aliased_object.nil?
end
- # @return [CodeObject::Proxy::Base] the object the current object is an
- # alias of
+ # @return [CodeObject::Proxy::Base] the object the current object is an alias of
def aliased_object
- object_lookup.find(self[:aliased_object_fullname])
+ object_lookup.find( self[:aliased_object_fullname] )
end
# @return [Boolean] +true+ if the object has an @api tag
def api_tag?
self[:api_tag?]
@@ -169,14 +168,13 @@
# @return [Boolean] +true+ if the object was tagged not to be documented
def nodoc?
self[:nodoc?]
end
- # @return [CodeObject::Proxy::Base,nil] the parent of the current object
- # or +nil+
+ # @return [CodeObject::Proxy::Base,nil] the parent of the current object or +nil+
def parent
- object_lookup.find(self[:parent_fullname])
+ object_lookup.find( self[:parent_fullname] )
end
def private?
self[:private?]
end
@@ -205,11 +203,11 @@
def source
self[:source]
end
def type
- self.class.to_s.gsub(/Object$/, "")
+ self.class.to_s.gsub(/Object$/, '')
end
# @return [Boolean] +true+ if the object has no documentation at all
def undocumented?
self[:undocumented?]
@@ -233,10 +231,10 @@
def marshal_load(attributes)
@attributes = attributes
end
def inspect
- "#<#{self.class}: #{fullname}>"
+ "#<#{self.class.to_s}: #{fullname}>"
end
end
end
end
end