Class: RGhost::Barcode::Parameter
- Inherits:
-
PsObject
- Object
- PsObject
- RGhost::Barcode::Parameter
show all
- Defined in:
- lib/rghost_barcode/rghost_barcode_base.rb
Instance Method Summary
collapse
Constructor Details
#initialize(options = nil) ⇒ Parameter
Returns a new instance of Parameter.
5
6
7
8
9
|
# File 'lib/rghost_barcode/rghost_barcode_base.rb', line 5
def initialize(options=nil)
@options=options
@params=[]
make() if options
end
|
Instance Method Details
#add(key, value) ⇒ Object
14
15
16
|
# File 'lib/rghost_barcode/rghost_barcode_base.rb', line 14
def add(key,value)
@params << "#{key}=#{value}" if value
end
|
#add_color(key, value) ⇒ Object
18
19
20
|
# File 'lib/rghost_barcode/rghost_barcode_base.rb', line 18
def add_color(key,value)
add(key, value.to_s.gsub(/[^0-9A-F]/,'') )
end
|
#add_single(entry) ⇒ Object
21
22
23
|
# File 'lib/rghost_barcode/rghost_barcode_base.rb', line 21
def add_single(entry)
@params << entry
end
|
#add_with_unit(key, value) ⇒ Object
26
27
28
29
30
31
|
# File 'lib/rghost_barcode/rghost_barcode_base.rb', line 26
def add_with_unit(key,value)
v=if RGhost::Config::GS[:unit] == RGhost::Units::Cm
(value.to_f/2.545)
end
add(key, v || value )
end
|
#inspect ⇒ Object
33
34
35
|
# File 'lib/rghost_barcode/rghost_barcode_base.rb', line 33
def inspect
"#{self.class} - #{map}"
end
|
#make ⇒ Object
39
|
# File 'lib/rghost_barcode/rghost_barcode_base.rb', line 39
def make() end
|
#map ⇒ Object
10
11
12
|
# File 'lib/rghost_barcode/rghost_barcode_base.rb', line 10
def map
@params.join(" ")
end
|
#to_s ⇒ Object
36
37
38
|
# File 'lib/rghost_barcode/rghost_barcode_base.rb', line 36
def to_s
map
end
|