Class: Spidy::DefinitionFile

Inherits:
Object
  • Object
show all
Defined in:
lib/spidy/definition_file.rb

Overview

spidy interface binding

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/spidy/definition_file.rb', line 5

def path
  @path
end

#spidyObject (readonly)

Returns the value of attribute spidy.



5
6
7
# File 'lib/spidy/definition_file.rb', line 5

def spidy
  @spidy
end

Class Method Details

.open(filepath) ⇒ Object



7
8
9
10
11
# File 'lib/spidy/definition_file.rb', line 7

def self.open(filepath)
  object = new(filepath)
  object.eval_definition
  object
end

Instance Method Details

#eval_definitionObject

rubocop:disable Security/Eval



14
15
16
# File 'lib/spidy/definition_file.rb', line 14

def eval_definition
  @spidy = eval(File.read(path)) if path
end