Sha256: c7c338c04bef9daeae6f89bffc5f22fbdebbc8a022e5f873c559922257a720ca

Contents?: true

Size: 1.14 KB

Versions: 9

Compression:

Stored size: 1.14 KB

Contents

module Osm

  class RegisterField
    include ::ActiveAttr::MassAssignmentSecurity
    include ::ActiveAttr::Model

    # @!attribute [rw] id
    #   @return [String] OSM identifier for the field
    # @!attribute [rw] name
    #   @return [String] Human readable name for the field
    # @!attribute [rw] tooltip
    #   @return [String] Tooltip for the field

    attribute :id, :type => String
    attribute :name, :type => String
    attribute :tooltip, :type => String, :default => ''

    attr_accessible :id, :name, :tooltip

    validates_presence_of :id
    validates_presence_of :name
    validates_presence_of :tooltip, :allow_blank => true


    # @!method initialize
    #   Initialize a new RegisterField
    #   @param [Hash] attributes the hash of attributes (see attributes for descriptions, use Symbol of attribute name as the key)


    # Initialize a new RegisterField from api data
    # @param [Hash] data the hash of data provided by the API
    def self.from_api(data)
      new({
        :id => data['field'],
        :name => data['name'],
        :tooltip => data['tooltip'],
      })
    end

  end # Class RegisterField

end # Module

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
osm-0.0.26 lib/osm/register_field.rb
osm-0.0.25 lib/osm/register_field.rb
osm-0.0.24 lib/osm/register_field.rb
osm-0.0.23 lib/osm/register_field.rb
osm-0.0.22 lib/osm/register_field.rb
osm-0.0.21 lib/osm/register_field.rb
osm-0.0.20 lib/osm/register_field.rb
osm-0.0.19 lib/osm/register_field.rb
osm-0.0.18 lib/osm/register_field.rb