Class: Oshpark::Project
Constant Summary
collapse
- STATES =
%w| NEW APPROVED AWAITING_REMOVAL |
Class Method Summary
collapse
Instance Method Summary
collapse
#area_in_square_inches, #area_in_square_mm, #height_in_inches, #height_in_mm, #width_in_inches, #width_in_mm
Methods included from Stateful
included
#destroy!, included, #reload!, #save!
Methods included from Model
#dirty?, included, #initialize
Class Method Details
.attrs ⇒ Object
5
6
7
|
# File 'lib/oshpark/project.rb', line 5
def self.attrs
%w| id design_file_url name description top_image bottom_image width_in_mils height_in_mils pcb_layers state layers order_options is_shared |
end
|
.write_attrs ⇒ Object
9
10
11
|
# File 'lib/oshpark/project.rb', line 9
def self.write_attrs
%w| name description |
end
|
Instance Method Details
#approve ⇒ Object
48
49
50
|
# File 'lib/oshpark/project.rb', line 48
def approve
reload_with Oshpark::client.approve_project id
end
|
#bottom_image ⇒ Object
24
25
26
|
# File 'lib/oshpark/project.rb', line 24
def bottom_image
Image.from_json @bottom_image
end
|
#height_in_mils ⇒ Object
44
45
46
|
# File 'lib/oshpark/project.rb', line 44
def height_in_mils
@height_in_mils || 0
end
|
#layers ⇒ Object
28
29
30
31
32
|
# File 'lib/oshpark/project.rb', line 28
def layers
@layers.map do |json|
Layer.from_json json
end
end
|
#order_options ⇒ Object
34
35
36
37
38
|
# File 'lib/oshpark/project.rb', line 34
def order_options
@order_options.map do |json|
OrderOption.from_json json
end
end
|
#top_image ⇒ Object
20
21
22
|
# File 'lib/oshpark/project.rb', line 20
def top_image
Image.from_json @top_image
end
|
#width_in_mils ⇒ Object
40
41
42
|
# File 'lib/oshpark/project.rb', line 40
def width_in_mils
@width_in_mils || 0
end
|