Class: CodeModels::StringArtifact

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

Returns a new instance of StringArtifact.



120
121
122
# File 'lib/codemodels/artifact.rb', line 120

def initialize(code)
  @code = code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

Instance Method Details

#==(other) ⇒ Object



152
153
154
# File 'lib/codemodels/artifact.rb', line 152

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

#absolute_startObject



124
125
126
127
128
129
# File 'lib/codemodels/artifact.rb', line 124

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

#embedded?Boolean

Returns:

  • (Boolean)


139
140
141
# File 'lib/codemodels/artifact.rb', line 139

def embedded?
  false
end

#embedding_levelObject



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

def embedding_level
  0
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#final_hostObject



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

def final_host
  self
end

#nameObject



156
157
158
# File 'lib/codemodels/artifact.rb', line 156

def name
  '<string>'
end

#to_sObject



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

def to_s
  "<StringArtifact>"
end