Class: PrintMap::Job

Inherits:
Object
  • Object
show all
Includes:
ArcServer::UrlHelper, Validatable
Defined in:
lib/print_map/job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#envObject (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

#bboxObject



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

#dpiObject



41
42
43
# File 'lib/print_map/job.rb', line 41

def dpi
  @dpi ||= env['dpi'] || 96
end

#page_layoutObject



33
34
35
# File 'lib/print_map/job.rb', line 33

def page_layout
  @page_layout ||= (env['page_layout'] || 'portrait').to_sym
end

#page_sizeObject



37
38
39
# File 'lib/print_map/job.rb', line 37

def page_size
  @page_size ||= env['page_size'] || 'A4'
end

#servicesObject



25
26
27
# File 'lib/print_map/job.rb', line 25

def services
  @services ||= env['services'].to_s.split(',')
end

#titleObject



45
46
47
# File 'lib/print_map/job.rb', line 45

def title
  @title = env['title'] || 'Untitled Map'
end