Permalink
Browse files

Style.

  • Loading branch information...
postmodern committed May 29, 2012
1 parent f9f1e85 commit 27b33edbd9506656c34b4fd06e48c515cddb558c
@@ -9,30 +9,30 @@ class BelongsToHandler < YARD::Handlers::Ruby::Base
handles method_call(:belongs_to)
def process
- nobj = effected_namespace
+ nobj = effected_namespace
mscope = scope
- name = statement.parameters[0].last
+ name = statement.parameters[0].last
if name.type == :symbol
name = name.source[1..-1]
register MethodObject.new(nobj, name, :class) do |o|
o.visibility = :public
- o.source = statement.source
- o.signature = "def self.#{name}"
+ o.source = statement.source
+ o.signature = "def self.#{name}"
o.parameters = [['repository', 'nil']]
end
register MethodObject.new(nobj, name, mscope) do |o|
o.visibility = :public
- o.source = statement.source
- o.signature = "def #{name}"
+ o.source = statement.source
+ o.signature = "def #{name}"
end
register MethodObject.new(nobj, "#{name}=", mscope) do |o|
o.visibility = :public
- o.source = statement.source
- o.signature = "def #{name}=(resource)"
+ o.source = statement.source
+ o.signature = "def #{name}=(resource)"
o.parameters = [['resource', nil]]
end
end
View
@@ -10,7 +10,7 @@ class HasHandler < YARD::Handlers::Ruby::Base
def process
args = statement.parameters
- n = args[0]
+ n = args[0]
name = args[1].last
return unless name.type == :symbol
@@ -26,27 +26,27 @@ def process
))
)
- nobj = effected_namespace
+ nobj = effected_namespace
mscope = scope
- name = name.source[1..-1]
+ name = name.source[1..-1]
register MethodObject.new(nobj, name, :class) do |o|
o.visibility = :public
- o.source = statement.source
- o.signature = "def self.#{name}"
+ o.source = statement.source
+ o.signature = "def self.#{name}"
o.parameters = [['repository', 'nil']]
end
register MethodObject.new(nobj, name, mscope) do |o|
o.visibility = :public
- o.source = statement.source
- o.signature = "def #{name}"
+ o.source = statement.source
+ o.signature = "def #{name}"
end
register MethodObject.new(nobj, "#{name}=", mscope) do |o|
o.visibility = :public
- o.source = statement.source
- o.signature = "def #{name}="
+ o.source = statement.source
+ o.signature = "def #{name}="
o.parameters = [["new_#{name}", nil]]
end
end
@@ -5,31 +5,31 @@ class BelongsToHandler < YARD::Handlers::Ruby::Legacy::Base
handles /\Abelongs_to\s+:/
- def process
- nobj = namespace
- mscope = scope
- name = statement.tokens[2,1].to_s[1..-1]
+ def process
+ nobj = namespace
+ mscope = scope
+ name = statement.tokens[2,1].to_s[1..-1]
- register MethodObject.new(nobj, name, :class) do |o|
- o.visibility = :public
- o.source = statement.source
- o.signature = "def self.#{name}"
- o.parameters = [['repository', 'nil']]
- end
+ register MethodObject.new(nobj, name, :class) do |o|
+ o.visibility = :public
+ o.source = statement.source
+ o.signature = "def self.#{name}"
+ o.parameters = [['repository', 'nil']]
+ end
- register MethodObject.new(nobj, name, mscope) do |o|
- o.visibility = :public
- o.source = statement.source
- o.signature = "def #{name}"
- end
+ register MethodObject.new(nobj, name, mscope) do |o|
+ o.visibility = :public
+ o.source = statement.source
+ o.signature = "def #{name}"
+ end
- register MethodObject.new(nobj, "#{name}=", mscope) do |o|
- o.visibility = :public
- o.source = statement.source
- o.signature = "def #{name}=(resource)"
- o.parameters = [['resource', nil]]
- end
+ register MethodObject.new(nobj, "#{name}=", mscope) do |o|
+ o.visibility = :public
+ o.source = statement.source
+ o.signature = "def #{name} = (resource)"
+ o.parameters = [['resource', nil]]
end
+ end
end
end
@@ -5,31 +5,31 @@ class HasHandler < YARD::Handlers::Ruby::Legacy::Base
handles /\Ahas\s+([1-9]\d*|n|(0|1)\.\.n),\s/
- def process
- nobj = namespace
- mscope = scope
- name = statement.tokens[2..-1].to_s[/:[^,]+/][1..-1]
+ def process
+ nobj = namespace
+ mscope = scope
+ name = statement.tokens[2..-1].to_s[/:[^,]+/][1..-1]
- register MethodObject.new(nobj, name, :class) do |o|
- o.visibility = :public
- o.source = statement.source
- o.signature = "def self.#{name}"
- o.parameters = [['repository', 'nil']]
- end
+ register MethodObject.new(nobj, name, :class) do |o|
+ o.visibility = :public
+ o.source = statement.source
+ o.signature = "def self.#{name}"
+ o.parameters = [['repository', 'nil']]
+ end
- register MethodObject.new(nobj, name, mscope) do |o|
- o.visibility = :public
- o.source = statement.source
- o.signature = "def #{name}"
- end
+ register MethodObject.new(nobj, name, mscope) do |o|
+ o.visibility = :public
+ o.source = statement.source
+ o.signature = "def #{name}"
+ end
- register MethodObject.new(nobj, "#{name}=", mscope) do |o|
- o.visibility = :public
- o.source = statement.source
- o.signature = "def #{name}="
- o.parameters = [["new_#{name}", nil]]
- end
+ register MethodObject.new(nobj, "#{name}=", mscope) do |o|
+ o.visibility = :public
+ o.source = statement.source
+ o.signature = "def #{name}="
+ o.parameters = [["new_#{name}", nil]]
end
+ end
end
end
@@ -5,31 +5,31 @@ class PropertyHandler < YARD::Handlers::Ruby::Legacy::Base
handles /\Aproperty\s+:/
- def process
- nobj = namespace
- mscope = scope
- name = statement.tokens[2,1].to_s[1..-1]
+ def process
+ nobj = namespace
+ mscope = scope
+ name = statement.tokens[2,1].to_s[1..-1]
- register MethodObject.new(nobj, name, :class) do |o|
- o.visibility = :public
- o.source = statement.source
- o.signature = "def #{nobj}.#{name}(repository=nil)"
- o.parameters = [['repository', 'nil']]
- end
+ register MethodObject.new(nobj, name, :class) do |o|
+ o.visibility = :public
+ o.source = statement.source
+ o.signature = "def #{nobj}.#{name}(repository=nil)"
+ o.parameters = [['repository', 'nil']]
+ end
- register MethodObject.new(nobj, name, mscope) do |o|
- o.visibility = :public
- o.source = statement.source
- o.signature = "def #{name}"
- end
+ register MethodObject.new(nobj, name, mscope) do |o|
+ o.visibility = :public
+ o.source = statement.source
+ o.signature = "def #{name}"
+ end
- register MethodObject.new(nobj, "#{name}=", mscope) do |o|
- o.visibility = :public
- o.source = statement.source
- o.signature = "def #{name}=(value)"
- o.parameters = [['value', nil]]
- end
+ register MethodObject.new(nobj, "#{name}=", mscope) do |o|
+ o.visibility = :public
+ o.source = statement.source
+ o.signature = "def #{name}=(value)"
+ o.parameters = [['value', nil]]
end
+ end
end
end
@@ -9,30 +9,30 @@ class PropertyHandler < YARD::Handlers::Ruby::Base
handles method_call(:property)
def process
- nobj = effected_namespace
+ nobj = effected_namespace
mscope = scope
- name = statement.parameters[0].last
+ name = statement.parameters[0].last
if name.type == :symbol
name = name.source[1..-1]
register MethodObject.new(nobj, name, :class) do |o|
o.visibility = :public
- o.source = statement.source
- o.signature = "def #{nobj}.#{name}(repository=nil)"
+ o.source = statement.source
+ o.signature = "def #{nobj}.#{name}(repository=nil)"
o.parameters = [['repository', 'nil']]
end
register MethodObject.new(nobj, name, mscope) do |o|
o.visibility = :public
- o.source = statement.source
- o.signature = "def #{name}"
+ o.source = statement.source
+ o.signature = "def #{name}"
end
register MethodObject.new(nobj, "#{name}=", mscope) do |o|
o.visibility = :public
- o.source = statement.source
- o.signature = "def #{name}=(value)"
+ o.source = statement.source
+ o.signature = "def #{name}=(value)"
o.parameters = [['value', nil]]
end
end

0 comments on commit 27b33ed

Please sign in to comment.