Skip to content

Commit

Permalink
Merge pull request #3 from meganemura/namespace
Browse files Browse the repository at this point in the history
Move classes to Reflekt module
  • Loading branch information
maedi authored Dec 26, 2020
2 parents c0317e7 + 9f94019 commit a959267
Show file tree
Hide file tree
Showing 26 changed files with 52 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/accessor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# - @@reflekt_skipped_methods on the instance's singleton class
################################################################################

module Reflekt
class Accessor

attr_accessor :config
Expand Down Expand Up @@ -35,3 +36,4 @@ def initialize()
end

end
end
2 changes: 2 additions & 0 deletions lib/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# 3. Meta
################################################################################

module Reflekt
class Action

attr_accessor :unique_id
Expand Down Expand Up @@ -86,3 +87,4 @@ def has_finished_reflecting?
end

end
end
2 changes: 2 additions & 0 deletions lib/action_stack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# @pattern Stack
################################################################################

module Reflekt
class ActionStack

def initialize()
Expand Down Expand Up @@ -42,3 +43,4 @@ def push(action)
end

end
end
2 changes: 2 additions & 0 deletions lib/clone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# 3. Clone <- YOU ARE HERE
################################################################################

module Reflekt
class Clone

def initialize(action)
Expand All @@ -29,3 +30,4 @@ def action(method, *new_args)
end

end
end
2 changes: 2 additions & 0 deletions lib/config.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module Reflekt
class Config

attr_accessor :enabled
Expand Down Expand Up @@ -40,3 +41,4 @@ def initialize()
end

end
end
2 changes: 2 additions & 0 deletions lib/control.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
require_relative 'reflection'
require_relative 'meta_builder'

module Reflekt
class Control < Reflection

##
Expand Down Expand Up @@ -81,3 +82,4 @@ def reflect(*args)
end

end
end
2 changes: 2 additions & 0 deletions lib/experiment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
require_relative 'reflection'
require_relative 'meta_builder'

module Reflekt
class Experiment < Reflection

##
Expand Down Expand Up @@ -79,3 +80,4 @@ def reflect(*args)
end

end
end
2 changes: 2 additions & 0 deletions lib/meta.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# 3. Meta <- YOU ARE HERE
################################################################################

module Reflekt
class Meta

##
Expand Down Expand Up @@ -69,3 +70,4 @@ def self.deserialize(meta)
end

end
end
2 changes: 2 additions & 0 deletions lib/meta/array_meta.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../meta'

module Reflekt
class ArrayMeta < Meta

def initialize()
Expand Down Expand Up @@ -32,3 +33,4 @@ def serialize()
end

end
end
2 changes: 2 additions & 0 deletions lib/meta/boolean_meta.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../meta'

module Reflekt
class BooleanMeta < Meta

def initialize()
Expand All @@ -24,3 +25,4 @@ def serialize()
end

end
end
2 changes: 2 additions & 0 deletions lib/meta/float_meta.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../meta'

module Reflekt
class FloatMeta < Meta

def initialize()
Expand All @@ -24,3 +25,4 @@ def serialize()
end

end
end
2 changes: 2 additions & 0 deletions lib/meta/integer_meta.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../meta'

module Reflekt
class IntegerMeta < Meta

def initialize()
Expand All @@ -24,3 +25,4 @@ def serialize()
end

end
end
2 changes: 2 additions & 0 deletions lib/meta/null_meta.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

require_relative '../meta'

module Reflekt
class NullMeta < Meta

def initialize()
Expand All @@ -32,3 +33,4 @@ def serialize()
end

end
end
2 changes: 2 additions & 0 deletions lib/meta/string_meta.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../meta'

module Reflekt
class StringMeta < Meta

def initialize()
Expand All @@ -24,3 +25,4 @@ def serialize()
end

end
end
2 changes: 2 additions & 0 deletions lib/meta_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# Require all meta.
Dir[File.join(__dir__, 'meta', '*.rb')].each { |file| require_relative file }

module Reflekt
class MetaBuilder

##
Expand Down Expand Up @@ -82,3 +83,4 @@ def self.data_type_to_meta_type(value)
end

end
end
2 changes: 2 additions & 0 deletions lib/reflection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
require_relative 'clone'
require_relative 'meta_builder'

module Reflekt
class Reflection

attr_reader :status
Expand Down Expand Up @@ -146,3 +147,4 @@ def serialize()
end

end
end
2 changes: 2 additions & 0 deletions lib/renderer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module Reflekt
class Renderer

def initialize(path, output_path)
Expand Down Expand Up @@ -37,3 +38,4 @@ def render()


end
end
2 changes: 2 additions & 0 deletions lib/rule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# @see lib/rules for rules.
################################################################################

module Reflekt
class Rule

attr_reader :type
Expand Down Expand Up @@ -50,3 +51,4 @@ def random()
end

end
end
2 changes: 2 additions & 0 deletions lib/rule_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
require_relative 'meta_builder'
require_relative 'meta/null_meta.rb'

module Reflekt
class RuleSet

attr_accessor :rules
Expand Down Expand Up @@ -107,3 +108,4 @@ def result()


end
end
2 changes: 2 additions & 0 deletions lib/rule_set_aggregator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

require_relative 'rule_set'

module Reflekt
class RuleSetAggregator

##
Expand Down Expand Up @@ -258,3 +259,4 @@ def set_output_rule_set(klass, method, rule_set)
end

end
end
2 changes: 2 additions & 0 deletions lib/rules/array_rule.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../rule'

module Reflekt
class ArrayRule < Rule

def initialize()
Expand Down Expand Up @@ -86,3 +87,4 @@ def random()
end

end
end
2 changes: 2 additions & 0 deletions lib/rules/boolean_rule.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'set'
require_relative '../rule'

module Reflekt
class BooleanRule < Rule

def initialize()
Expand Down Expand Up @@ -45,3 +46,4 @@ def random()
end

end
end
2 changes: 2 additions & 0 deletions lib/rules/float_rule.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../rule'

module Reflekt
class FloatRule < Rule

def initialize()
Expand Down Expand Up @@ -55,3 +56,4 @@ def random()
end

end
end
2 changes: 2 additions & 0 deletions lib/rules/integer_rule.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../rule'

module Reflekt
class IntegerRule < Rule

def initialize()
Expand Down Expand Up @@ -55,3 +56,4 @@ def random()
end

end
end
2 changes: 2 additions & 0 deletions lib/rules/null_rule.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../rule'

module Reflekt
class NullRule < Rule

def initialize()
Expand Down Expand Up @@ -31,3 +32,4 @@ def random()
end

end
end
2 changes: 2 additions & 0 deletions lib/rules/string_rule.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../rule'

module Reflekt
class StringRule < Rule

attr_accessor :min_length
Expand Down Expand Up @@ -79,3 +80,4 @@ def random()
end

end
end

0 comments on commit a959267

Please sign in to comment.