Class: Fort::Src::Code::DependedModule

Inherits:
Object
  • Object
show all
Extended by:
RubyPatch::AutoLoad
Defined in:
lib/fort/src/code/depended_module.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, intrinsic_mode = nil) ⇒ DependedModule

Returns a new instance of DependedModule.

Raises:

  • (ArgumentError)


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_modeObject (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

#nameObject (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

Returns:

  • (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

#hashObject



34
35
36
# File 'lib/fort/src/code/depended_module.rb', line 34

def hash
  [@name, @intrinsic_mode].hash
end