Module: Pakyow::Support::Bindable

Defined in:
lib/pakyow/support/bindable.rb

Overview

Makes an object bindable.

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



12
13
14
15
16
# File 'lib/pakyow/support/bindable.rb', line 12

def [](key)
  if include?(key)
    public_send(key.to_s.to_sym)
  end
end

#include?(key) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/pakyow/support/bindable.rb', line 8

def include?(key)
  respond_to?(key.to_s.to_sym)
end