Class: Clases::Imposicion

Inherits:
Object
  • Object
show all
Defined in:
lib/imposition/clases.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(w_, h_, wP_, hP_, nX, nY, nPaginas, nPliegos, cuadernillos) ⇒ Imposicion

Returns a new instance of Imposicion.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/imposition/clases.rb', line 8

def initialize(w_,h_,wP_,hP_,nX,nY,nPaginas,nPliegos,cuadernillos)
  @w_=w_
  @h_=h_
  @wP_=wP_
  @hP_=hP_
  @nX=nX
  @nY=nY
  @nPaginas=nPaginas
  @nPliegos=nPliegos
  @cuadernillos=cuadernillos
  #con unidad
  @w=@w_["numero"].send(@w_["unidad"])
  @h=@h_["numero"].send(@h_["unidad"])
  @wP=@wP_["numero"].send(@wP_["unidad"])
  @hP=@hP_["numero"].send(@hP_["unidad"])
  #sin unidad
  @nX=@nX["numero"].to_f.floor
  @nY=@nY["numero"].to_f.floor
  @nPaginas=@nPaginas["numero"].to_f.floor
  @nPliegos=@nPliegos["numero"].to_f.floor
end

Instance Attribute Details

#bookletzObject

Returns the value of attribute bookletz.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def bookletz
  @bookletz
end

#cuadernillosObject

Returns the value of attribute cuadernillos.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def cuadernillos
  @cuadernillos
end

#cuadernillosPorCosturaObject

Returns the value of attribute cuadernillosPorCostura.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def cuadernillosPorCostura
  @cuadernillosPorCostura
end

#hObject

Returns the value of attribute h.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def h
  @h
end

#h_Object

Returns the value of attribute h_.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def h_
  @h_
end

#hPObject

Returns the value of attribute hP.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def hP
  @hP
end

#hP_Object

Returns the value of attribute hP_.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def hP_
  @hP_
end

#hRealObject

Returns the value of attribute hReal.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def hReal
  @hReal
end

#nPaginasObject

Returns the value of attribute nPaginas.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def nPaginas
  @nPaginas
end

#nPaginasRealObject

Returns the value of attribute nPaginasReal.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def nPaginasReal
  @nPaginasReal
end

#nPliegosObject

Returns the value of attribute nPliegos.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def nPliegos
  @nPliegos
end

#nXObject

Returns the value of attribute nX.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def nX
  @nX
end

#nYObject

Returns the value of attribute nY.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def nY
  @nY
end

#sizeObject

Returns the value of attribute size.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def size
  @size
end

#wObject

Returns the value of attribute w.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def w
  @w
end

#w_Object

Returns the value of attribute w_.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def w_
  @w_
end

#wPObject

Returns the value of attribute wP.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def wP
  @wP
end

#wP_Object

Returns the value of attribute wP_.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def wP_
  @wP_
end

#wRealObject

Returns the value of attribute wReal.



7
8
9
# File 'lib/imposition/clases.rb', line 7

def wReal
  @wReal
end

Instance Method Details

#to_sObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/imposition/clases.rb', line 29

def to_s
  nXm=@nX
  if @cuadernillos then
    nXm*=2
  end
  str=I18n.t(:params)+"\n"
  str+="nX:"+nXm.to_s+"\n"
  str+="nY:"+@nY.to_s+"\n"
  str+=I18n.t(:nPages)+":"+@nPaginas.to_s+"\n"
  str+=I18n.t(:nSheets)+":"+@nPliegos.to_s+"\n"
  str+=I18n.t(:pwidth)+":"+@w.to_s+" "+@w_["unidad"]+"\n"
  str+=I18n.t(:pheight)+":"+@h.to_s+" "+@h_["unidad"]+"\n"
  str+=I18n.t(:swidth)+":"+@wP.to_s+" "+@wP_["unidad"]+"\n"
  str+=I18n.t(:sheight)+":"+@hP.to_s+" "+@hP_["unidad"]+"\n"
  return str
end