Sha256: 041022362547eedc4fd26f0a0d168226f5eae86df8ebf975172921e0842d6cde

Contents?: true

Size: 393 Bytes

Versions: 2

Compression:

Stored size: 393 Bytes

Contents

#:enddoc:
module RailsConnector
  class Attribute
    attr_reader :name, :type

    def initialize(data)
      @name, @type = data['name'], data['type'].to_sym
    end

    def self.by_name(name)
      data = Workspace.current.attributes[name.to_s]
      new(data) if data
    end

    def self.type_of(name)
      attribute = by_name(name)
      attribute.type if attribute
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
infopark_cloud_connector-6.8.0.beta.200.713.e5c3150 lib/rails_connector/attribute.rb
infopark_cloud_connector-6.8.0.beta.200.681.7c84f4a lib/rails_connector/attribute.rb