Class: RGhost::Dash
- Includes:
- RubyToPs
- Defined in:
- lib/rghost/dash.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :style => [1,2,3], :offset => 0 }
Constants included from RubyToPs
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.
44 45 46 47 48 49 50 51 |
# File 'lib/rghost/dash.rb', line 44 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
53 54 55 56 |
# File 'lib/rghost/dash.rb', line 53 def ps ary=to_array( [@options[:style]].flatten) "#{ary}#{@options[:offset]} setdash" end |