Class: PDF::Extractor::Font
- Inherits:
-
Object
- Object
- PDF::Extractor::Font
- Defined in:
- lib/pdf/extractor.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#style ⇒ Object
Returns the value of attribute style.
Instance Method Summary collapse
- #bold? ⇒ Boolean
-
#initialize(params = {}) ⇒ Font
constructor
A new instance of Font.
- #italic? ⇒ Boolean
- #normal? ⇒ Boolean
Constructor Details
#initialize(params = {}) ⇒ Font
Returns a new instance of Font.
43 44 45 46 47 48 |
# File 'lib/pdf/extractor.rb', line 43 def initialize(params = {}) @id = params[:id] @size = params[:size].to_f @name = params[:name] @style = :normal end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
40 41 42 |
# File 'lib/pdf/extractor.rb', line 40 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
40 41 42 |
# File 'lib/pdf/extractor.rb', line 40 def name @name end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
40 41 42 |
# File 'lib/pdf/extractor.rb', line 40 def size @size end |
#style ⇒ Object
Returns the value of attribute style.
41 42 43 |
# File 'lib/pdf/extractor.rb', line 41 def style @style end |
Instance Method Details
#bold? ⇒ Boolean
51 |
# File 'lib/pdf/extractor.rb', line 51 def bold?; @style == :bold end |
#italic? ⇒ Boolean
52 |
# File 'lib/pdf/extractor.rb', line 52 def italic?; @style == :italic end |
#normal? ⇒ Boolean
50 |
# File 'lib/pdf/extractor.rb', line 50 def normal?; @style == :normal end |