Class: PrintMap::Job
- Inherits:
-
Object
- Object
- PrintMap::Job
- Includes:
- ArcServer::UrlHelper, Validatable
- Defined in:
- lib/print_map/job.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
- #bbox ⇒ Object
- #dpi ⇒ Object
-
#initialize(env = {}) ⇒ Job
constructor
A new instance of Job.
- #page_layout ⇒ Object
- #page_size ⇒ Object
- #services ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(env = {}) ⇒ Job
Returns a new instance of Job.
21 22 23 |
# File 'lib/print_map/job.rb', line 21 def initialize(env = {}) @env = env end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
19 20 21 |
# File 'lib/print_map/job.rb', line 19 def env @env end |
Instance Method Details
#bbox ⇒ Object
29 30 31 |
# File 'lib/print_map/job.rb', line 29 def bbox @bbox ||= env['bbox'].to_s.split(',').collect{ |b| b.to_f } end |
#dpi ⇒ Object
41 42 43 |
# File 'lib/print_map/job.rb', line 41 def dpi @dpi ||= env['dpi'] || 96 end |
#page_layout ⇒ Object
33 34 35 |
# File 'lib/print_map/job.rb', line 33 def page_layout @page_layout ||= (env['page_layout'] || 'portrait').to_sym end |
#page_size ⇒ Object
37 38 39 |
# File 'lib/print_map/job.rb', line 37 def page_size @page_size ||= env['page_size'] || 'A4' end |
#services ⇒ Object
25 26 27 |
# File 'lib/print_map/job.rb', line 25 def services @services ||= env['services'].to_s.split(',') end |
#title ⇒ Object
45 46 47 |
# File 'lib/print_map/job.rb', line 45 def title @title = env['title'] || 'Untitled Map' end |