Class: CodeModels::FileArtifact

Inherits:
Artifact
  • Object
show all
Defined in:
lib/codemodels/artifact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Artifact

#point_to_absolute, #position_to_absolute

Constructor Details

#initialize(filename, code) ⇒ FileArtifact

Returns a new instance of FileArtifact.



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

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

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



83
84
85
# File 'lib/codemodels/artifact.rb', line 83

def code
  @code
end

#filenameObject (readonly)

Returns the value of attribute filename.



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

def filename
  @filename
end

Instance Method Details

#==(other) ⇒ Object



118
119
120
# File 'lib/codemodels/artifact.rb', line 118

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

#absolute_startObject



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

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

#embedded?Boolean

Returns:

  • (Boolean)


105
106
107
# File 'lib/codemodels/artifact.rb', line 105

def embedded?
	false
end

#embedding_levelObject



109
110
111
# File 'lib/codemodels/artifact.rb', line 109

def embedding_level
	0
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


113
114
115
116
# File 'lib/codemodels/artifact.rb', line 113

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

#final_hostObject



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

def final_host
	self
end

#nameObject



122
123
124
# File 'lib/codemodels/artifact.rb', line 122

def name
	filename
end

#to_sObject



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

def to_s
	"File #{filename}"
end