Sha256: 4e5003e26b5f7d811f9a64efc4214d357ef29c773c048708632dc16755ca420f

Contents?: true

Size: 266 Bytes

Versions: 35

Compression:

Stored size: 266 Bytes

Contents

module AttributeHelper
  def attributes=(hash)
    hash.each do |key, value|
      instance_variable_set("@#{key}", value)
    end
  end

  def attributes
    Hash[instance_variables.map { |name| [name.to_s[1..-1], instance_variable_get(name)] }]
  end
end

Version data entries

35 entries across 35 versions & 3 rubygems

Version Path
sitra_client-0.3.2 lib/sitra_client/attribute_helper.rb
sitra_client-0.3.1 lib/sitra_client/attribute_helper.rb
sitra_client-0.3.0 lib/sitra_client/attribute_helper.rb
movies_client-0.0.15 lib/movies_client/attribute_helper.rb
sitra_client-0.2.0 lib/sitra_client/attribute_helper.rb
sitra_client-0.1.0 lib/sitra_client/attribute_helper.rb
movies_client-0.0.14 lib/movies_client/attribute_helper.rb
movies_client-0.0.13 lib/movies_client/attribute_helper.rb
movies_client-0.0.12 lib/movies_client/attribute_helper.rb
movies_client-0.0.11 lib/movies_client/attribute_helper.rb
movies_client-0.0.10 lib/movies_client/attribute_helper.rb
movies_client-0.0.9 lib/movies_client/attribute_helper.rb
movies_client-0.0.8 lib/movies_client/attribute_helper.rb
movies_client-0.0.7 lib/movies_client/attribute_helper.rb
movies_client-0.0.6 lib/movies_client/attribute_helper.rb
movies_client-0.0.5 lib/movies_client/attribute_helper.rb
movies_client-0.0.4 lib/movies_client/attribute_helper.rb
movies_client-0.0.3 lib/movies_client/attribute_helper.rb
movies_client-0.0.2 lib/movies_client/attribute_helper.rb
movies_client-0.0.1 lib/movies_client/attribute_helper.rb