Sha256: 291d4ef20bda63521c5b7baf9f6ff026bb49f87ce5c16a18a3b47f1f5f861545

Contents?: true

Size: 568 Bytes

Versions: 15

Compression:

Stored size: 568 Bytes

Contents

module VagrantPlugins
  module Skytap
    module API
      module SpecifiedAttributes
        module ClassMethods
          def reads(*names)
            @readables ||= []

            names.each do |name|
              define_method(name) do
                get_api_attribute(name.to_s)
              end
            end
          end
        end

        def get_api_attribute(name)
          attrs.fetch(name.to_s, nil)
        end

        def self.included(base)
          base.singleton_class.send(:include, ClassMethods)
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
vagrant-skytap-0.2.3 lib/vagrant-skytap/api/specified_attributes.rb
vagrant-skytap-0.2.2 lib/vagrant-skytap/api/specified_attributes.rb
vagrant-skytap-0.2.1 lib/vagrant-skytap/api/specified_attributes.rb
vagrant-skytap-0.2.0 lib/vagrant-skytap/api/specified_attributes.rb
vagrant-skytap-0.1.11 lib/vagrant-skytap/api/specified_attributes.rb
vagrant-skytap-0.1.10 lib/vagrant-skytap/api/specified_attributes.rb
vagrant-skytap-0.1.9 lib/vagrant-skytap/api/specified_attributes.rb
vagrant-skytap-0.1.8 lib/vagrant-skytap/api/specified_attributes.rb
vagrant-skytap-0.1.7 lib/vagrant-skytap/api/specified_attributes.rb
vagrant-skytap-0.1.6 lib/vagrant-skytap/api/specified_attributes.rb
vagrant-skytap-0.1.5 lib/vagrant-skytap/api/specified_attributes.rb
vagrant-skytap-0.1.4 lib/vagrant-skytap/api/specified_attributes.rb
vagrant-skytap-0.1.3 lib/vagrant-skytap/api/specified_attributes.rb
vagrant-skytap-0.1.2 lib/vagrant-skytap/api/specified_attributes.rb
vagrant-skytap-0.1.1a lib/vagrant-skytap/api/specified_attributes.rb