Class: Prawn::Blank::Appearance

Inherits:
Object
  • Object
show all
Defined in:
lib/prawn/blank/appearance.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Appearance

Returns a new instance of Appearance.



5
6
7
8
9
# File 'lib/prawn/blank/appearance.rb', line 5

def initialize(options={})
  options.each do |k,v|
    self.send "#{k.to_s}=".to_sym,v
  end
end

Instance Attribute Details

#fontObject

Returns the value of attribute font.



3
4
5
# File 'lib/prawn/blank/appearance.rb', line 3

def font
  @font
end

#font_sizeObject

Returns the value of attribute font_size.



3
4
5
# File 'lib/prawn/blank/appearance.rb', line 3

def font_size
  @font_size
end

#font_subsetObject

Returns the value of attribute font_subset.



3
4
5
# File 'lib/prawn/blank/appearance.rb', line 3

def font_subset
  @font_subset
end

Class Method Details

.cast(hsh) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/prawn/blank/appearance.rb', line 11

def self.cast(hsh)
  if hsh.kind_of? self
    return hsh
  else
    return self.new(hsh)
  end
end

Instance Method Details

#to_sObject



19
20
21
# File 'lib/prawn/blank/appearance.rb', line 19

def to_s
  Prawn::LiteralString.new "/#{font.identifier_for(0)} #{font_size} Tf"
end