Module: Ruote::WithH

Included in:
Exp::FlowExpression, FlowExpressionId, Workitem
Defined in:
lib/ruote/util/hashdot.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) included(target)



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/ruote/util/hashdot.rb', line 74

def self.included(target)

  def target.h_reader(*names)

    names.each do |name|

      define_method(name) { @h[name.to_s] }
    end
  end

  def target.h_accessor(*names)

    names.each do |name|

      define_method(name) { @h[name.to_s] }
      define_method("#{name}=") { |val| @h[name.to_s] = val }
    end
  end
end

Instance Method Details

- (Object) h



64
65
66
67
# File 'lib/ruote/util/hashdot.rb', line 64

def h

  @hw ||= HashWrapper.new(@h)
end

- (Object) h=(hash)



58
59
60
61
62
# File 'lib/ruote/util/hashdot.rb', line 58

def h=(hash)

  @h = hash
  @hw = nil
end

- (Object) to_h



69
70
71
72
# File 'lib/ruote/util/hashdot.rb', line 69

def to_h

  @h
end