Class: Gamefic::Block
- Inherits:
-
Object
- Object
- Gamefic::Block
- Defined in:
- lib/gamefic/block.rb
Overview
A code container for seeds and scripts.
Instance Attribute Summary collapse
- #code ⇒ Proc readonly
- #type ⇒ Symbol readonly
Instance Method Summary collapse
-
#initialize(type, code) ⇒ Block
constructor
A new instance of Block.
- #script? ⇒ Boolean
- #seed? ⇒ Boolean
Constructor Details
#initialize(type, code) ⇒ Block
Returns a new instance of Block.
15 16 17 18 |
# File 'lib/gamefic/block.rb', line 15 def initialize type, code @type = type @code = code end |
Instance Attribute Details
#code ⇒ Proc (readonly)
11 12 13 |
# File 'lib/gamefic/block.rb', line 11 def code @code end |
#type ⇒ Symbol (readonly)
8 9 10 |
# File 'lib/gamefic/block.rb', line 8 def type @type end |
Instance Method Details
#script? ⇒ Boolean
20 21 22 |
# File 'lib/gamefic/block.rb', line 20 def script? type == :script end |
#seed? ⇒ Boolean
24 25 26 |
# File 'lib/gamefic/block.rb', line 24 def seed? type == :seed end |