Class: Rubinius::ConstantScope
- Inherits:
-
Object
- Object
- Rubinius::ConstantScope
- Defined in:
- lib/myco/bootstrap/find_constant.rb
Instance Attribute Summary collapse
-
#is_myco_level ⇒ Object
readonly
Returns the value of attribute is_myco_level.
-
#myco_category ⇒ Object
readonly
Returns the value of attribute myco_category.
-
#myco_component ⇒ Object
readonly
Returns the value of attribute myco_component.
-
#myco_file ⇒ Object
readonly
TODO: Can this be more graceful and more eager?.
-
#myco_meme ⇒ Object
readonly
Returns the value of attribute myco_meme.
Instance Method Summary collapse
- #get_myco_constant_ref(name) ⇒ Object
- #inspect ⇒ Object
- #inspect_list ⇒ Object
- #myco_levels ⇒ Object
- #myco_parent ⇒ Object
- #set_myco_category ⇒ Object
- #set_myco_component ⇒ Object
- #set_myco_file ⇒ Object
- #set_myco_meme(value) ⇒ Object
Instance Attribute Details
#is_myco_level ⇒ Object (readonly)
Returns the value of attribute is_myco_level.
9 10 11 |
# File 'lib/myco/bootstrap/find_constant.rb', line 9 def is_myco_level @is_myco_level end |
#myco_category ⇒ Object (readonly)
Returns the value of attribute myco_category.
7 8 9 |
# File 'lib/myco/bootstrap/find_constant.rb', line 7 def myco_category @myco_category end |
#myco_component ⇒ Object (readonly)
Returns the value of attribute myco_component.
6 7 8 |
# File 'lib/myco/bootstrap/find_constant.rb', line 6 def myco_component @myco_component end |
#myco_file ⇒ Object (readonly)
TODO: Can this be more graceful and more eager?
21 22 23 |
# File 'lib/myco/bootstrap/find_constant.rb', line 21 def myco_file @myco_file end |
#myco_meme ⇒ Object (readonly)
Returns the value of attribute myco_meme.
8 9 10 |
# File 'lib/myco/bootstrap/find_constant.rb', line 8 def myco_meme @myco_meme end |
Instance Method Details
#get_myco_constant_ref(name) ⇒ Object
75 76 77 78 |
# File 'lib/myco/bootstrap/find_constant.rb', line 75 def get_myco_constant_ref(name) @myco_constant_refs ||= Rubinius::LookupTable.new @myco_constant_refs[name] ||= ::Myco::ConstantReference.new(name, self) end |
#inspect ⇒ Object
16 17 18 |
# File 'lib/myco/bootstrap/find_constant.rb', line 16 def inspect "#<#{self.class}:#{inspect_list}>" end |
#inspect_list ⇒ Object
11 12 13 14 |
# File 'lib/myco/bootstrap/find_constant.rb', line 11 def inspect_list this_item = "0x#{object_id.to_s(16)} #{self.module}" parent ? "#{this_item}, #{parent.inspect_list}" : this_item end |
#myco_levels ⇒ Object
25 26 27 |
# File 'lib/myco/bootstrap/find_constant.rb', line 25 def myco_levels @myco_levels ||= (parent ? parent.myco_levels.dup : []) end |
#myco_parent ⇒ Object
29 30 31 32 33 34 |
# File 'lib/myco/bootstrap/find_constant.rb', line 29 def myco_parent parent = parent() parent ? ( parent.is_myco_level ? parent : parent.myco_parent ) : nil end |
#set_myco_category ⇒ Object
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/myco/bootstrap/find_constant.rb', line 58 def set_myco_category raise "myco_category already set for thie ConstantScope" \ if @myco_category @myco_category = self.module @myco_component = parent.myco_component @myco_file = parent.myco_file myco_levels << @myco_category @is_myco_level = true end |
#set_myco_component ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/myco/bootstrap/find_constant.rb', line 48 def set_myco_component raise "myco_component already set for thie ConstantScope" \ if @myco_component @myco_component = self.module @myco_file = parent.myco_file myco_levels << @myco_component @is_myco_level = true end |
#set_myco_file ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/myco/bootstrap/find_constant.rb', line 36 def set_myco_file raise "myco_file already set for thie ConstantScope" \ if @myco_file @myco_component = self.module @myco_file = self.module @myco_file.instance_variable_set(:@constant_scope, self) myco_levels << @myco_file @is_myco_level = true end |
#set_myco_meme(value) ⇒ Object
69 70 71 72 73 |
# File 'lib/myco/bootstrap/find_constant.rb', line 69 def set_myco_meme value raise "myco_meme already set for thie ConstantScope" \ if @myco_meme @myco_meme = value end |