Class: RGhost::Dash

Inherits:
PsObject show all
Includes:
RubyToPs
Defined in:
lib/rghost/dash.rb

Constant Summary collapse

DEFAULT_OPTIONS =
{
  :style => [1,2,3],
  :offset => 0
  
}

Instance Method Summary collapse

Methods included from RubyToPs

#array_to_stack, #hash_to_array, #pack_string, #ps_escape, #string_eval, #to_array, #to_bool, #to_string, #to_string_array

Methods inherited from PsObject

#<<, #call, #graphic_scope, #raw, #set, #to_s

Constructor Details

#initialize(options = {}) ⇒ Dash

Returns a new instance of Dash.



45
46
47
48
49
50
51
52
# File 'lib/rghost/dash.rb', line 45

def initialize(options={})
  super(""){}
  if options.is_a?(Numeric) || options.is_a?(Array)
    @options = DEFAULT_OPTIONS.dup.merge(:style => options)
  else
    @options = DEFAULT_OPTIONS.dup.merge(options)
  end
end

Instance Method Details

#psObject



54
55
56
57
# File 'lib/rghost/dash.rb', line 54

def ps
  ary=to_array( [@options[:style]].flatten)
  "#{ary}#{@options[:offset]} setdash"
end