Class: Chouette::AccessLink
Constant Summary
collapse
- @@access_link_types =
nil
- @@link_orientation_types =
nil
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#build_objectid, #clean_object_id, #default_values, #fix_uniq_objectid, model_name, object_id_key, #objectid, #objectid_format_compliance, #prefix, #prepare_auto_columns, #reset_auto_columns, #timestamp_attributes_for_create, #timestamp_attributes_for_update, #uniq_objectid
#human_attribute_name, #nil_if_blank
Instance Attribute Details
#access_link_type ⇒ Object
Returns the value of attribute access_link_type.
6
7
8
|
# File 'app/models/chouette/access_link.rb', line 6
def access_link_type
@access_link_type
end
|
#link_key ⇒ Object
Returns the value of attribute link_key.
6
7
8
|
# File 'app/models/chouette/access_link.rb', line 6
def link_key
@link_key
end
|
#link_orientation_type ⇒ Object
Returns the value of attribute link_orientation_type.
6
7
8
|
# File 'app/models/chouette/access_link.rb', line 6
def link_orientation_type
@link_orientation_type
end
|
Class Method Details
.access_link_types ⇒ Object
35
36
37
|
# File 'app/models/chouette/access_link.rb', line 35
def self.access_link_types
@@access_link_types ||= Chouette::ConnectionLinkType.all
end
|
.build_link_key(access_point, stop_area, link_orientation_type) ⇒ Object
60
61
62
63
64
65
66
|
# File 'app/models/chouette/access_link.rb', line 60
def self.build_link_key(access_point,stop_area,link_orientation_type)
if link_orientation_type == "access_point_to_stop_area"
"A_#{access_point.id}-S_#{stop_area.id}"
else
"S_#{stop_area.id}-A_#{access_point.id}"
end
end
|
.link_orientation_types ⇒ Object
48
49
50
|
# File 'app/models/chouette/access_link.rb', line 48
def self.link_orientation_types
@@link_orientation_types ||= Chouette::LinkOrientationType.all
end
|
.nullable_attributes ⇒ Object
21
22
23
24
|
# File 'app/models/chouette/access_link.rb', line 21
def self.nullable_attributes
[:link_distance, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration,
:mobility_restricted_traveller_duration]
end
|
Instance Method Details
#geometry ⇒ Object
52
53
54
|
# File 'app/models/chouette/access_link.rb', line 52
def geometry
GeoRuby::SimpleFeatures::LineString.from_points( [ access_point.geometry, stop_area.geometry], 4326) if access_point.geometry and stop_area.geometry
end
|
#geometry_presenter ⇒ Object
68
69
70
|
# File 'app/models/chouette/access_link.rb', line 68
def geometry_presenter
Chouette::Geometry::AccessLinkPresenter.new self
end
|