Class: CodeModels::StringArtifact

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(code) ⇒ StringArtifact

Returns a new instance of StringArtifact.



131
132
133
# File 'lib/codemodels/artifact.rb', line 131

def initialize(code)
  @code = code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



129
130
131
# File 'lib/codemodels/artifact.rb', line 129

def code
  @code
end

Instance Method Details

#==(other) ⇒ Object



163
164
165
# File 'lib/codemodels/artifact.rb', line 163

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

#absolute_startObject



135
136
137
138
139
140
# File 'lib/codemodels/artifact.rb', line 135

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

#embedded?Boolean

Returns:

  • (Boolean)


150
151
152
# File 'lib/codemodels/artifact.rb', line 150

def embedded?
  false
end

#embedding_levelObject



154
155
156
# File 'lib/codemodels/artifact.rb', line 154

def embedding_level
  0
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


158
159
160
161
# File 'lib/codemodels/artifact.rb', line 158

def eql?(other)
  return false unless other.is_a?(StringArtifact)
  self.code==other.code
end

#final_hostObject



146
147
148
# File 'lib/codemodels/artifact.rb', line 146

def final_host
  self
end

#nameObject



167
168
169
# File 'lib/codemodels/artifact.rb', line 167

def name
  '<string>'
end

#to_sObject



142
143
144
# File 'lib/codemodels/artifact.rb', line 142

def to_s
  "<StringArtifact>"
end