Class: NudgeType::CodeType

Inherits:
Object
  • Object
show all
Extended by:
TypeBehaviors
Defined in:
lib/interpreter/types/codeType.rb

Constant Summary collapse

@@defaultPoints =
20

Class Method Summary collapse

Methods included from TypeBehaviors

any_value, extended, from_s, random_value, recognizes?, to_nudgecode

Class Method Details

.any_value(options = {}) ⇒ Object



17
18
19
# File 'lib/interpreter/types/codeType.rb', line 17

def self.any_value(options = {})
  StringRewritingGenerator.new(options).generate
end

.from_s(string_value) ⇒ Object



13
14
15
# File 'lib/interpreter/types/codeType.rb', line 13

def self.from_s(string_value)
  return string_value.sub(/\(/,"«").sub(/\)/,"»")
end

.recognizes?(thing) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/interpreter/types/codeType.rb', line 8

def self.recognizes?(thing)
  return thing.kind_of?(String)
end