Class: RGhost::Dash
- Includes:
- RubyToPs
- Defined in:
- lib/rghost/dash.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :style => [1,2,3], :offset => 0 }
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Dash
constructor
A new instance of Dash.
- #ps ⇒ Object
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(={}) super(""){} if .is_a?(Numeric) || .is_a?(Array) @options = DEFAULT_OPTIONS.dup.merge(:style => ) else @options = DEFAULT_OPTIONS.dup.merge() end end |
Instance Method Details
#ps ⇒ Object
54 55 56 57 |
# File 'lib/rghost/dash.rb', line 54 def ps ary=to_array( [@options[:style]].flatten) "#{ary}#{@options[:offset]} setdash" end |