class Gitomator::ServiceProvider::HostingLocal::ModelObject
A small wrapper that takes a hash, and create an attr_accessor for each hash key. This is a temporary implementation, until we create proper model objects (e.g. HostedRepo, Team, PullRequest, etc.)
Public Class Methods
new(hash)
click to toggle source
# File lib/gitomator/service_provider/hosting_local.rb, line 20 def initialize(hash) hash.each do |key, value| setter = "#{key}=" self.class.send(:attr_accessor, key) if !respond_to?(setter) send setter, value end end