Class: Gamefic::Block

Inherits:
Object
  • Object
show all
Defined in:
lib/gamefic/block.rb

Overview

A code container for seeds and scripts.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, code) ⇒ Block

Returns a new instance of Block.

Parameters:

  • type (Symbol)
  • code (Proc)


15
16
17
18
# File 'lib/gamefic/block.rb', line 15

def initialize type, code
  @type = type
  @code = code
end

Instance Attribute Details

#codeProc (readonly)

Returns:

  • (Proc)


11
12
13
# File 'lib/gamefic/block.rb', line 11

def code
  @code
end

#typeSymbol (readonly)

Returns:

  • (Symbol)


8
9
10
# File 'lib/gamefic/block.rb', line 8

def type
  @type
end

Instance Method Details

#script?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/gamefic/block.rb', line 20

def script?
  type == :script
end

#seed?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/gamefic/block.rb', line 24

def seed?
  type == :seed
end