Class: EideticRML::Styles::PageStyle

Inherits:
Style
  • Object
show all
Defined in:
lib/erml_styles.rb

Instance Method Summary collapse

Methods inherited from Style

for_name, #from_points, #id, #initialize, #initialize_copy, register

Methods included from EideticRML::Support

#from_units, parse_measurement, parse_measurement_pts, #to_units

Constructor Details

This class inherits a constructor from EideticRML::Styles::Style

Instance Method Details

#height(units = :pt) ⇒ Object



253
254
255
# File 'lib/erml_styles.rb', line 253

def height(units=:pt)
  from_points(EideticPDF::PageStyle::SIZES[size][orientation == :portrait ? 1 : 0], units)
end

#orientation(value = nil) ⇒ Object



257
258
259
260
# File 'lib/erml_styles.rb', line 257

def orientation(value=nil)
  return @orientation || :portrait if value.nil?
  @orientation = value.to_sym if [:portrait, :landscape].include?(value.to_sym)
end

#size(value = nil) ⇒ Object



262
263
264
265
# File 'lib/erml_styles.rb', line 262

def size(value=nil)
  return @size || :letter if value.nil?
  @size = value.to_sym if EideticPDF::PageStyle::SIZES[value.to_sym]
end

#width(units = :pt) ⇒ Object



267
268
269
# File 'lib/erml_styles.rb', line 267

def width(units=:pt)
  from_points(EideticPDF::PageStyle::SIZES[size][orientation == :portrait ? 0 : 1], units)
end