Class: Roart::History

Inherits:
Object
  • Object
show all
Defined in:
lib/roart/history.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.allObject



53
54
55
# File 'lib/roart/history.rb', line 53

def all
  @histories ||= get_all
end

.default(options) ⇒ Object



43
44
45
46
47
# File 'lib/roart/history.rb', line 43

def default(options)
  history = self.dup
  history.instance_variable_set("@default_options", options)
  history.all
end

.default_optionsObject



57
58
59
# File 'lib/roart/history.rb', line 57

def default_options
  @default_options
end

.ticketObject



49
50
51
# File 'lib/roart/history.rb', line 49

def ticket
  @default_options[:ticket]
end

Instance Method Details

#add_methods!Object

TODO Figure out why i can’t include Roart::MethodFunctions



33
34
35
36
37
38
39
# File 'lib/roart/history.rb', line 33

def add_methods!
  @attributes.each do |key, value|
    (class << self; self; end).send :define_method, key do
      return value
    end
  end 
end