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.



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

def path
  @path
end

#spidyObject (readonly)

Returns the value of attribute spidy.



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

def spidy
  @spidy
end

Class Method Details

.open(filepath) ⇒ Object



10
11
12
13
14
# File 'lib/spidy/definition_file.rb', line 10

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

Instance Method Details

#eval_definitionObject

rubocop:disable Security/Eval



17
18
19
# File 'lib/spidy/definition_file.rb', line 17

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