Class: Adva::Static::Import::Source::Base
- Inherits:
-
Object
- Object
- Adva::Static::Import::Source::Base
- Defined in:
- lib/adva/static/import/source/base.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #data ⇒ Object
-
#initialize(path) ⇒ Base
constructor
A new instance of Base.
- #model_name ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(path) ⇒ Base
Returns a new instance of Base.
12 13 14 |
# File 'lib/adva/static/import/source/base.rb', line 12 def initialize(path) @path = normalize_path(path) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'lib/adva/static/import/source/base.rb', line 10 def path @path end |
Instance Method Details
#<=>(other) ⇒ Object
28 29 30 |
# File 'lib/adva/static/import/source/base.rb', line 28 def <=>(other) path <=> other.path end |
#data ⇒ Object
20 21 22 |
# File 'lib/adva/static/import/source/base.rb', line 20 def data @data ||= Hashr.new(read || {}) end |
#model_name ⇒ Object
24 25 26 |
# File 'lib/adva/static/import/source/base.rb', line 24 def model_name @model_name ||= self.class.name.demodulize end |
#to_hash ⇒ Object
16 17 18 |
# File 'lib/adva/static/import/source/base.rb', line 16 def to_hash data end |