Class: Chouette::AccessLink
- Inherits:
-
TridentActiveRecord
- Object
- ActiveRecord::Base
- ActiveRecord
- TridentActiveRecord
- Chouette::AccessLink
- Defined in:
- app/models/chouette/access_link.rb
Constant Summary collapse
- @@access_link_types =
nil
- @@link_orientation_types =
nil
Instance Attribute Summary collapse
-
#access_link_type ⇒ Object
Returns the value of attribute access_link_type.
-
#link_key ⇒ Object
Returns the value of attribute link_key.
-
#link_orientation_type ⇒ Object
Returns the value of attribute link_orientation_type.
Class Method Summary collapse
- .access_link_types ⇒ Object
- .build_link_key(access_point, stop_area, link_orientation_type) ⇒ Object
- .link_orientation_types ⇒ Object
Instance Method Summary collapse
Methods inherited from TridentActiveRecord
#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
Methods inherited from ActiveRecord
#human_attribute_name, #nil_if_blank, nullable_attributes
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
31 32 33 |
# File 'app/models/chouette/access_link.rb', line 31 def self.access_link_types @@access_link_types ||= Chouette::ConnectionLinkType.all end |
.build_link_key(access_point, stop_area, link_orientation_type) ⇒ Object
56 57 58 59 60 61 62 |
# File 'app/models/chouette/access_link.rb', line 56 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
44 45 46 |
# File 'app/models/chouette/access_link.rb', line 44 def self.link_orientation_types @@link_orientation_types ||= Chouette::LinkOrientationType.all end |
Instance Method Details
#geometry ⇒ Object
48 49 50 |
# File 'app/models/chouette/access_link.rb', line 48 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
64 65 66 |
# File 'app/models/chouette/access_link.rb', line 64 def geometry_presenter Chouette::Geometry::AccessLinkPresenter.new self end |