Class: Gradient::GRD
- Inherits:
-
Object
- Object
- Gradient::GRD
- Defined in:
- lib/gradient/grd.rb
Constant Summary collapse
- SHIFT_BUFFER =
" "- COLOR_TERMS =
%w(Cyn Mgnt Ylw Blck Rd Grn Bl H Strt Brgh)
- PARSE_METHODS =
{ "patt" => :parse_patt, "desc" => :parse_desc, "VlLs" => :parse_vlls, "TEXT" => :parse_text, "Objc" => :parse_objc, "UntF" => :parse_untf, "bool" => :parse_bool, "long" => :parse_long, "doub" => :parse_doub, "enum" => :parse_enum, "tdta" => :parse_tdta, }
Instance Attribute Summary collapse
-
#maps ⇒ Object
readonly
Returns the value of attribute maps.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file) ⇒ GRD
constructor
A new instance of GRD.
Constructor Details
#initialize(file) ⇒ GRD
Returns a new instance of GRD.
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/gradient/grd.rb', line 30 def initialize(file) @maps = {} @gradients = [] @gradient_names = [] @current_object_name = "" @current_gradient = [] @current_color = {} @shift = 0 File.open(file, "r") do |file| parse while (@buffer = file.gets) end end |
Instance Attribute Details
#maps ⇒ Object (readonly)
Returns the value of attribute maps.
20 21 22 |
# File 'lib/gradient/grd.rb', line 20 def maps @maps end |
Class Method Details
.parse(file) ⇒ Object
24 25 26 |
# File 'lib/gradient/grd.rb', line 24 def parse(file) new(file).maps end |