Sha256: 0ca278ef62b23f177b5c17df86a196c28fae6df20f557bbbc5ba73941be02b78

Contents?: true

Size: 339 Bytes

Versions: 4

Compression:

Stored size: 339 Bytes

Contents

module CanTango::Api
  module Attributes
    [:read, :edit].each do |action|
      define_method :"#{action}_attribute" do |name|
        :"#{action}_attr_#{name}"
      end

      define_method :"#{action}_attributes" do |*names|
        names.select_symbols.map { |name| send("#{action}_attribute", name) }
      end
    end
  end
end


Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cantango-api-0.1.3 lib/cantango/api/attributes.rb
cantango-api-0.1.2 lib/cantango/api/attributes.rb
cantango-api-0.1.1 lib/cantango/api/attributes.rb
cantango-api-0.1.0 lib/cantango/api/attributes.rb