Class: Fort::Src::Code::DependedModule
- Inherits:
-
Object
- Object
- Fort::Src::Code::DependedModule
- Extended by:
- RubyPatch::AutoLoad
- Defined in:
- lib/fort/src/code/depended_module.rb
Instance Attribute Summary collapse
-
#intrinsic_mode ⇒ Object
readonly
Returns the value of attribute intrinsic_mode.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(name, intrinsic_mode = nil) ⇒ DependedModule
constructor
A new instance of DependedModule.
Constructor Details
#initialize(name, intrinsic_mode = nil) ⇒ DependedModule
Returns a new instance of DependedModule.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fort/src/code/depended_module.rb', line 10 def initialize(name, intrinsic_mode = nil) @name = name @intrinsic_mode = if intrinsic_mode.nil? if ::Fort::INTRINSIC_MODULES.include?(name) :both else :non_intrinsic end else intrinsic_mode end raise ArgumentError unless [:intrinsic, :non_intrinsic, :both].include?(@intrinsic_mode) end |
Instance Attribute Details
#intrinsic_mode ⇒ Object (readonly)
Returns the value of attribute intrinsic_mode.
8 9 10 |
# File 'lib/fort/src/code/depended_module.rb', line 8 def intrinsic_mode @intrinsic_mode end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/fort/src/code/depended_module.rb', line 8 def name @name end |
Instance Method Details
#==(other) ⇒ Object
24 25 26 27 28 |
# File 'lib/fort/src/code/depended_module.rb', line 24 def ==(other) self.class == other.class\ && @name == other.name\ && @intrinsic_mode == other.intrinsic_mode end |
#eql?(other) ⇒ Boolean
30 31 32 |
# File 'lib/fort/src/code/depended_module.rb', line 30 def eql?(other) self.class == other.class && self.hash == other.hash end |
#hash ⇒ Object
34 35 36 |
# File 'lib/fort/src/code/depended_module.rb', line 34 def hash [@name, @intrinsic_mode].hash end |