Class: PdfExtract::Pdf
- Inherits:
-
Object
- Object
- PdfExtract::Pdf
- Defined in:
- lib/pdf.rb
Instance Attribute Summary collapse
-
#operating_type ⇒ Object
Returns the value of attribute operating_type.
-
#settings ⇒ Object
Returns the value of attribute settings.
-
#spatial_builders ⇒ Object
Returns the value of attribute spatial_builders.
-
#spatial_calls ⇒ Object
Returns the value of attribute spatial_calls.
-
#spatial_objects ⇒ Object
Returns the value of attribute spatial_objects.
-
#spatial_options ⇒ Object
Returns the value of attribute spatial_options.
Instance Method Summary collapse
- #[](type) ⇒ Object
- #explicit_call?(name) ⇒ Boolean
-
#initialize ⇒ Pdf
constructor
A new instance of Pdf.
- #method_missing(name, *args) ⇒ Object
- #paged_objects(type) ⇒ Object
- #set(setting, value, agent = "") ⇒ Object
- #spatials(name, options = {}, &block) ⇒ Object
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
184 185 186 |
# File 'lib/pdf.rb', line 184 def method_missing name, *args raise "No such spatial type #{name}" end |
Instance Attribute Details
#operating_type ⇒ Object
Returns the value of attribute operating_type.
181 182 183 |
# File 'lib/pdf.rb', line 181 def @operating_type end |
#settings ⇒ Object
Returns the value of attribute settings.
182 183 184 |
# File 'lib/pdf.rb', line 182 def settings @settings end |
#spatial_builders ⇒ Object
Returns the value of attribute spatial_builders.
181 182 183 |
# File 'lib/pdf.rb', line 181 def spatial_builders @spatial_builders end |
#spatial_calls ⇒ Object
Returns the value of attribute spatial_calls.
181 182 183 |
# File 'lib/pdf.rb', line 181 def spatial_calls @spatial_calls end |
#spatial_objects ⇒ Object
Returns the value of attribute spatial_objects.
181 182 183 |
# File 'lib/pdf.rb', line 181 def spatial_objects @spatial_objects end |
#spatial_options ⇒ Object
Returns the value of attribute spatial_options.
182 183 184 |
# File 'lib/pdf.rb', line 182 def @spatial_options end |
Instance Method Details
#[](type) ⇒ Object
217 218 219 |
# File 'lib/pdf.rb', line 217 def [](type) @spatial_objects[type] end |
#explicit_call?(name) ⇒ Boolean
200 201 202 |
# File 'lib/pdf.rb', line 200 def explicit_call? name @spatial_calls.count { |obj| obj[:name] == name and obj[:explicit] } > 0 end |
#paged_objects(type) ⇒ Object
204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/pdf.rb', line 204 def paged_objects type paged_objs = {} if @spatial_objects[type] @spatial_objects[type].each do |obj| paged_objs[obj[:page]] ||= [] paged_objs[obj[:page]] << obj end end paged_objs end |
#set(setting, value, agent = "") ⇒ Object
221 222 223 |
# File 'lib/pdf.rb', line 221 def set setting, value, agent="" @settings.set setting, value, agent end |
#spatials(name, options = {}, &block) ⇒ Object
188 189 190 |
# File 'lib/pdf.rb', line 188 def spatials name, = {}, &block add_spatials_method name, , &block end |