move from known attributes to volotile (white to blacklist)
This commit is contained in:
parent
6b19b915a1
commit
2f5ed43073
@ -1,6 +1,6 @@
|
|||||||
require_relative "util"
|
require_relative "util"
|
||||||
require_relative "members"
|
require_relative "members"
|
||||||
require_relative "known"
|
require_relative "volotile"
|
||||||
require_relative "writer"
|
require_relative "writer"
|
||||||
require_relative "array"
|
require_relative "array"
|
||||||
require_relative "occurence"
|
require_relative "occurence"
|
||||||
@ -10,11 +10,6 @@ Symbol.class_eval do
|
|||||||
io.write ":#{to_s}"
|
io.write ":#{to_s}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
NilClass.class_eval do
|
|
||||||
def to_sof(io,members)
|
|
||||||
io.write "nil"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
TrueClass.class_eval do
|
TrueClass.class_eval do
|
||||||
def to_sof(io , members)
|
def to_sof(io , members)
|
||||||
io.write "true"
|
io.write "true"
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
module Sof
|
|
||||||
class Known
|
|
||||||
@@mapping = {
|
|
||||||
Virtual::MethodDefinition => [:name , :args , :receiver , :return_type , :blocks]
|
|
||||||
}
|
|
||||||
def self.is clazz
|
|
||||||
@@mapping.has_key? clazz
|
|
||||||
end
|
|
||||||
def self.attributes clazz
|
|
||||||
@@mapping[clazz]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -15,11 +15,8 @@ module Sof
|
|||||||
end
|
end
|
||||||
|
|
||||||
def attributes_for object
|
def attributes_for object
|
||||||
if( Known.is( object.class ))
|
attributes = object.instance_variables.collect{|i| i.to_s[1..-1].to_sym } # chop of @
|
||||||
Known.attributes(object.class)
|
attributes - Volotile.attributes(object.class)
|
||||||
else
|
|
||||||
object.instance_variables.collect{|i| i.to_s[1..-1].to_sym } # chop of @
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
10
lib/sof/volotile.rb
Normal file
10
lib/sof/volotile.rb
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
module Sof
|
||||||
|
class Volotile
|
||||||
|
@@mapping = {
|
||||||
|
Virtual::MethodDefinition => []
|
||||||
|
}
|
||||||
|
def self.attributes clazz
|
||||||
|
@@mapping[clazz] || []
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user