Class: CodeModels::FileArtifact

Inherits:
AbstractArtifact show all
Defined in:
lib/codemodels/artifact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractArtifact

#point_to_absolute, #position_to_absolute

Constructor Details

#initialize(filename, code) ⇒ FileArtifact

Returns a new instance of FileArtifact.



74
75
76
77
# File 'lib/codemodels/artifact.rb', line 74

def initialize(filename,code)
  @filename = filename
  @code = code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



72
73
74
# File 'lib/codemodels/artifact.rb', line 72

def code
  @code
end

#filenameObject (readonly)

Returns the value of attribute filename.



71
72
73
# File 'lib/codemodels/artifact.rb', line 71

def filename
  @filename
end

Instance Method Details

#==(other) ⇒ Object



107
108
109
# File 'lib/codemodels/artifact.rb', line 107

def ==(other)
  self.eql?(other)
end

#absolute_startObject



79
80
81
82
83
84
# File 'lib/codemodels/artifact.rb', line 79

def absolute_start
  sp = SourcePoint.new
  sp.line   = 1
  sp.column = 1
  sp
end

#embedded?Boolean

Returns:

  • (Boolean)


94
95
96
# File 'lib/codemodels/artifact.rb', line 94

def embedded?
  false
end

#embedding_levelObject



98
99
100
# File 'lib/codemodels/artifact.rb', line 98

def embedding_level
  0
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


102
103
104
105
# File 'lib/codemodels/artifact.rb', line 102

def eql?(other)
  return false unless other.is_a?(FileArtifact)
  self.filename==other.filename && self.code==other.code
end

#final_hostObject



90
91
92
# File 'lib/codemodels/artifact.rb', line 90

def final_host
  self
end

#nameObject



111
112
113
# File 'lib/codemodels/artifact.rb', line 111

def name
  filename
end

#to_sObject



86
87
88
# File 'lib/codemodels/artifact.rb', line 86

def to_s
  "File #{filename}"
end