Module: Skylab::Myterm::AppscriptDelegator
- Included in:
- ItermProxy::SessionProxy
- Defined in:
- lib/myterm/api.rb
Instance Method Summary collapse
- #delegated_attr_accessors(*list) ⇒ Object
- #delegated_attr_readers(*list) ⇒ Object
- #delegated_attr_writers(*list) ⇒ Object
Instance Method Details
#delegated_attr_accessors(*list) ⇒ Object
170 171 172 173 |
# File 'lib/myterm/api.rb', line 170 def delegated_attr_accessors *list delegated_attr_readers(*list) delegated_attr_writers(*list) end |
#delegated_attr_readers(*list) ⇒ Object
150 151 152 153 154 155 156 157 158 |
# File 'lib/myterm/api.rb', line 150 def delegated_attr_readers *list list.each do |property| lambda do |_property| define_method(_property) do resource.send(_property).get end end.call(property) end end |
#delegated_attr_writers(*list) ⇒ Object
160 161 162 163 164 165 166 167 168 |
# File 'lib/myterm/api.rb', line 160 def delegated_attr_writers *list list.each do |property| lambda do |_property| define_method("#{_property}=") do |val| resource.send(_property).set val end end.call(property) end end |