Class: Fort::Src::Code::DependedModule
- Inherits:
-
Object
- Object
- Fort::Src::Code::DependedModule
- 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.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/fort/src/code/depended_module.rb', line 7 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.
5 6 7 |
# File 'lib/fort/src/code/depended_module.rb', line 5 def intrinsic_mode @intrinsic_mode end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/fort/src/code/depended_module.rb', line 5 def name @name end |
Instance Method Details
#==(other) ⇒ Object
21 22 23 24 25 |
# File 'lib/fort/src/code/depended_module.rb', line 21 def ==(other) self.class == other.class\ && @name == other.name\ && @intrinsic_mode == other.intrinsic_mode end |
#eql?(other) ⇒ Boolean
27 28 29 |
# File 'lib/fort/src/code/depended_module.rb', line 27 def eql?(other) self.class == other.class && self.hash == other.hash end |
#hash ⇒ Object
31 32 33 |
# File 'lib/fort/src/code/depended_module.rb', line 31 def hash [@name, @intrinsic_mode].hash end |