Module: Thwart::Resource::ClassMethods

Defined in:
lib/thwart/resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#thwart_nameObject

Returns the value of attribute thwart_name.



14
15
16
# File 'lib/thwart/resource.rb', line 14

def thwart_name
  @thwart_name
end

Instance Method Details

#ensure_attributes_set!Object



32
33
34
# File 'lib/thwart/resource.rb', line 32

def ensure_attributes_set!
  raise Thwart::MissingAttributeError if self.thwart_name == nil
end

#thwart_access(&block) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/thwart/resource.rb', line 21

def thwart_access(&block) 
  @thwarted = true
  
  # Set up DSL using dsl helper
  if block_given? 
    dsl = Thwart::Dsl.new(:name => :thwart_name=)
    dsl.evaluate(self, &block)
  end
  self.ensure_attributes_set!
end