Class: ROM::Files::Attribute

Inherits:
Attribute
  • Object
show all
Defined in:
lib/rom/files/attribute.rb

Instance Method Summary collapse

Instance Method Details

#call(pathname) ⇒ Object

Parameters:

Returns:

  • (Object)


12
13
14
15
16
17
18
# File 'lib/rom/files/attribute.rb', line 12

def call(pathname)
  return type[pathname.read] if meta[Files::DATA]
  return type[pathname.stat] if meta[:__stat__].is_a?(TrueClass)
  return type[pathname.stat.send(meta[:__stat__])] if meta[:__stat__]
  return type[meta[:__proc__].(pathname)] if meta[:__proc__]
  type[pathname]
end