Class: MockFont

Inherits:
Object show all
Includes:
MockCalls
Defined in:
lib/gamebox/spec/helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, size) ⇒ MockFont

Returns a new instance of MockFont.



296
297
298
299
300
# File 'lib/gamebox/spec/helper.rb', line 296

def initialize(name, size)
  _reset!
  @name = name
  @size = size
end

Instance Attribute Details

#callsObject

Returns the value of attribute calls.



294
295
296
# File 'lib/gamebox/spec/helper.rb', line 294

def calls
  @calls
end

#nameObject

Returns the value of attribute name.



294
295
296
# File 'lib/gamebox/spec/helper.rb', line 294

def name
  @name
end

#sizeObject

Returns the value of attribute size.



294
295
296
# File 'lib/gamebox/spec/helper.rb', line 294

def size
  @size
end

Instance Method Details

#heightObject



304
305
306
# File 'lib/gamebox/spec/helper.rb', line 304

def height
  size
end

#text_width(text) ⇒ Object



301
302
303
# File 'lib/gamebox/spec/helper.rb', line 301

def text_width(text)
  size * text.size
end