Class: RubyCraft::BlockColor
- Inherits:
-
Object
- Object
- RubyCraft::BlockColor
- Defined in:
- lib/rubycraft/block_type.rb
Constant Summary collapse
- InvertedColor =
Instance Attribute Summary collapse
-
#b ⇒ Object
readonly
Returns the value of attribute b.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#g ⇒ Object
readonly
Returns the value of attribute g.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#r ⇒ Object
readonly
Returns the value of attribute r.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, r, g, b, data) ⇒ BlockColor
constructor
A new instance of BlockColor.
- #rgb ⇒ Object
Constructor Details
#initialize(name, r, g, b, data) ⇒ BlockColor
Returns a new instance of BlockColor.
135 136 137 138 139 140 141 |
# File 'lib/rubycraft/block_type.rb', line 135 def initialize(name, r, g, b, data) @name = name @r = r @g = g @b = b @data = data end |
Instance Attribute Details
#b ⇒ Object (readonly)
Returns the value of attribute b.
134 135 136 |
# File 'lib/rubycraft/block_type.rb', line 134 def b @b end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
134 135 136 |
# File 'lib/rubycraft/block_type.rb', line 134 def data @data end |
#g ⇒ Object (readonly)
Returns the value of attribute g.
134 135 136 |
# File 'lib/rubycraft/block_type.rb', line 134 def g @g end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
134 135 136 |
# File 'lib/rubycraft/block_type.rb', line 134 def name @name end |
#r ⇒ Object (readonly)
Returns the value of attribute r.
134 135 136 |
# File 'lib/rubycraft/block_type.rb', line 134 def r @r end |
Class Method Details
.method_missing(name, *args) ⇒ Object
125 126 127 128 |
# File 'lib/rubycraft/block_type.rb', line 125 def self.method_missing(name, *args) args << @typeColor.size @typeColor << new(name, *args) end |
.typeColor ⇒ Object
130 131 132 |
# File 'lib/rubycraft/block_type.rb', line 130 def self.typeColor @typeColor end |
Instance Method Details
#rgb ⇒ Object
143 144 145 |
# File 'lib/rubycraft/block_type.rb', line 143 def rgb [r, g, b] end |