Sha256: c309ecf0da2ffb2e049c7a4a2f3cc3df22594ba56ed75d58689ef1f8214f2065

Contents?: true

Size: 578 Bytes

Versions: 54

Compression:

Stored size: 578 Bytes

Contents

module Inbox
  module Parameters
    def self.included(base)
      base.extend(ClassMethods)
    end

    def parameters
      self.class.instance_variable_get("@parameters")
    end

    module ClassMethods
      def parameter(*params)
        @parameters ||= []
        params.each do |param|
          attr_accessor param
          @parameters << param.to_s
        end
      end

      def inherited(subclass)
        parameters = instance_variable_get("@parameters") || []
        subclass.instance_variable_set("@parameters", parameters.clone)
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 2 rubygems

Version Path
nylas-2.0.1 lib/parameters.rb
inbox-2.0.1 lib/parameters.rb
nylas-2.0.0 lib/parameters.rb
inbox-2.0.0 lib/parameters.rb
nylas-1.3.0 lib/parameters.rb
inbox-1.3.0 lib/parameters.rb
nylas-1.2.1 lib/parameters.rb
inbox-1.2.1 lib/parameters.rb
nylas-1.1.0 lib/parameters.rb
inbox-1.1.0 lib/parameters.rb
nylas-1.0.0 lib/parameters.rb
inbox-1.0.0 lib/parameters.rb
nylas-0.18.2 lib/parameters.rb
inbox-0.18.2 lib/parameters.rb
nylas-0.18.1 lib/parameters.rb
inbox-0.18.1 lib/parameters.rb
inbox-0.18.0 lib/parameters.rb
nylas-0.18.0 lib/parameters.rb
nylas-0.17.4 lib/parameters.rb
inbox-0.17.4 lib/parameters.rb