Class: Windy::Record

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

Direct Known Subclasses

Column, View

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Record

Returns a new instance of Record.



171
172
173
# File 'lib/windy.rb', line 171

def initialize(attributes)
  self.attributes = attributes
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



183
184
185
186
187
188
189
# File 'lib/windy.rb', line 183

def method_missing(method, *args, &block)
  if respond_to?(method)
    @attributes[method.to_s]
  else
    super
  end
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



169
170
171
# File 'lib/windy.rb', line 169

def attributes
  @attributes
end

Instance Method Details

#inspectObject



191
192
193
# File 'lib/windy.rb', line 191

def inspect
  "#<#{self.class.name}:#{id}>"
end

#respond_to?(method) ⇒ Boolean

Returns:

  • (Boolean)


179
180
181
# File 'lib/windy.rb', line 179

def respond_to?(method)
  @attributes.has_key?(method.to_s) || super
end