lib/inat/data/entity/project.rb in inat-get-0.8.0.12 vs lib/inat/data/entity/project.rb in inat-get-0.8.0.13

- old
+ new

@@ -4,31 +4,35 @@ require_relative '../types/extras' require_relative '../types/location' require_relative '../entity' require_relative '../enums/projecttype' -# require_relative 'projectadmin' -# require_relative 'projectobservationrule' +module INat::Entity + autoload :Observation, 'inat/data/entity/observation' + autoload :User, 'inat/data/entity/user' + autoload :Place, 'inat/data/entity/place' + autoload :ProjectAdmin, 'inat/data/entity/projectadmin' + autoload :ProjectObservationRule, 'inat/data/entity/projectobservationrule' + autoload :Flag, 'inat/data/entity/flag' + autoload :Taxon, 'inat/data/entity/taxon' +end -autoload :Observation, 'inat/data/entity/observation' -autoload :User, 'inat/data/entity/user' -autoload :Place, 'inat/data/entity/place' -autoload :ProjectAdmin, 'inat/data/entity/projectadmin' -autoload :ProjectObservationRule, 'inat/data/entity/projectobservationrule' -autoload :Flag, 'inat/data/entity/flag' -autoload :Taxon, 'inat/data/entity/taxon' +class INat::Entity::Project < INat::Data::Entity -class Project < Entity + include INat::Data::Types + include INat::Entity extend BySLUG api_path :projects api_part :query api_limit 200 table :projects + # @!group Fields + field :slug, type: Symbol, index: true field :title, type: String, index: true, required: true field :description, type: String field :project_type, type: ProjectType, index: true field :is_umbrella, type: Boolean, index: true @@ -84,9 +88,11 @@ ignore :project_observation_fields ignore :site_features ignore :terms ignore :search_parameters ignore :rule_preferences + + # @!endgroup def to_s "<a href=\"https://www.inaturalist.org/projects/#{ id }\"><i class=\"fa fa-briefcase\"></i>  #{ title }</a>" end